Compute a Sequence of Equally Spaced Round values in R Programming - pretty() Function Last Updated : 15 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report pretty() function in R Language is used to decide sequence of equally spaced round values. Syntax: pretty(x, n) Parameters: x: It is defined as vector data n: length of resultant vector Returns: data vector of equal length interval Example 1: r # Create example vector # Apply pretty function to vector x <- 1:50 pretty(x) Output: [1] 0 10 20 30 40 50 Example 2: r # Create example vector x <- 1:50 # Apply pretty function to vector pretty(x, n = 10) Output: [1] 0 5 10 15 20 25 30 35 40 45 50 Here n = 10 states that the interval vector consisting of ten intervals, i.e. n+1 elements. Example 3: r # Create example vectors x <- 1:50 y <- 1:50 # Create plot of two vectors plot(x, y, # Default axis labels main = " Axis Labels") Output: Example : R # Generate some data x <- seq(0, 10, length.out = 100) y <- sin(x) # Create a plot of the data plot(x, y, type = "l", col = "blue", lwd = 2, main = "Sine Function", xlab = "x", ylab = "y") # Add tick marks to the x-axis ticks <- pretty(x, n = 10) axis(1, at = ticks, labels = round(ticks, 2)) output : Comment More infoAdvertise with us Next Article Compute the Value of Poisson Quantile Function in R Programming - qpois() Function K kaurbal1698 Follow Improve Article Tags : R Language R Vector-Function Similar Reads Rounding off a value to specific digits in R Programming - round() Function R Language provides an inbuilt function round() which rounds off to the given number of digits, if no number of digits is provided for round off, it rounds off the number to the nearest integer. Syntax: round(x, digits=n) Parameter: x: Number to be rounded off digit: Specified digits Example 1: Pyth 1 min read Rounding off to the ceiling or floor value in R Programming - trunc() Function trunc() function in R Language is used to return the largest integer that is smaller than or equal to x (i.e : rounds downs the nearest integer). trunc() function behaves as a ceiling function for negative number and floor function for positive number. Syntax: trunc(x) Parameter: x: Numeric value to 1 min read Creating a Vector of sequenced elements in R Programming - seq() Function In This article, we will discuss how we Create a Vector of sequenced elements in R Programming Language using seq() Function. What are sequenced elements?Sequenced elements mean things that are placed in a particular order, one after another. This concept is often used in various fields. seq() Funct 2 min read Compute the Value of Poisson Quantile Function in R Programming - qpois() Function qpois() function in R Language is used to compute the value of Poisson Quantile Function. It creates a quantile density plot for poisson distribution. Syntax: qpois(vec, lambda) Parameters: vec: Sequence of integer values lambda: Average number of events per interval Example 1: Python3 1== # R progr 2 min read Generate Data sets of same Random Values in R Programming - set.seed() Function The set.seed() function in R ensures that random number generation is consistent across different sessions, allowing for identical results each time the code is executed. This is particularly important when sharing code with others or when results need to be verified.Syntax: set.seed(n)Where:n: seed 2 min read Create a Random Sequence of Numbers within t-Distribution in R Programming - rt() Function rt() function in R Language is used to create a random sequence of values from Student t-distribution. Syntax: rt(n, df, ncp) Parameters: n: Number of observations df: Degree of Freedom ncp: Numeric vector of non-centrality parameters. Example 1: Python3 1== # R Program to create random sequence # f 1 min read Like