Rounding up to the Specified Number of Significant Digits in R Programming - signif() Function Last Updated : 10 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report signif() function in R Language is used to round to the specified number of significant digits. Syntax: signif(x, digits) Parameters: x: specified number digits: significant digits Example 1: Python3 # R program to illustrate # signif function # Generating random number x <- rnorm(1) x # Calling the signif() function signif(x) Output: [1] 1.064923 [1] 1.06492 Example 2: Python3 # R program to illustrate # signif function # Generating random number x <- rnorm(1) x # Calling the signif() function # with 3 significant digits signif(x, 3) Output: [1] 1.078385 [1] 1.08 Note: The rnorm() function generates different random number each time when it runs. Comment More infoAdvertise with us Next Article Rounding up to the Specified Number of Significant Digits in R Programming - signif() Function K Kanchan_Ray Follow Improve Article Tags : R Language R Math-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 Get the Sign of Elements of a Numeric Vector in R Programming - sign() Function sign() function in R Language is used to find the sign of the elements of the numeric vector provided as argument. It does not work on complex vectors. Syntax: sign(x) Parameter: x represents numeric vector Returns: 1 for Positive number and -1 for Negative Number Example 1: r # Create a variable x 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 Convert String to Integer in R Programming - strtoi() Function strtoi() function in R Language is used to convert the specified string to integers. Syntax: strtoi(x, base=0L) Parameters: x: character vector base: integer between 2 and 36 inclusive, default is 0 Example 1: Python3 # R program to illustrate # strtoi function # Initializing some string vector x 1 min read Compute a Sequence of Equally Spaced Round values in R Programming - pretty() Function 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 vec 2 min read Like