Rounding off values in R Language - round() Function Last Updated : 15 Apr, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report round() function in R Language is used to round off values to a specific number of decimal value. Syntax: round(x, digits)Parameters: x: Value to be round off digits: Number of digits to which value has to be round off Example 1: Rounding off the values Python3 # R program to illustrate # round function # Create example values x1 <- 1.2 x2 <- 1.8 x3 <- - 1.3 x4 <- 1.7 # Apply round function round(x1) round(x2) round(x3) round(x4) print(x1, x2, x3, x4) Output : 1 2 -1 2 Here in the above code, we have round off the values with 4 data x1, x2, x3, and x4 using the function round(), and printed the new values.Example 2: Rounding off to certain digits Python3 # R program to illustrate # round to a certain digit # Create numeric with many digits x2 <- 3.14734343243 # Round to three decimal places round(x2, digits = 3) print(x2) Output: 3.147 Here in the above code, the value of a numeric vector is round off till 3 digits. Comment More infoAdvertise with us Next Article Rounding off values in R Language - round() Function A akhilsharma870 Follow Improve Article Tags : R Language 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 Calculate Square root of a number in R Language - sqrt() Function Square Root of a number is the value that yields the original number when multiplied by itself. If "x" is a number, its square root is written in mathematical notation as âx. we can calculate the square root in R using the sqrt() function. In the R Programming Language, we have an inbuilt function k 2 min read round_any() Function of plyr Package in R In this article, we will discuss the round_any() function with its examples from plyr() package in the R programming language. Installation Before knowing this, we have to install and load the plyr() package. Syntax to install and load the plyr package in the R console: Install: install.packages("pl 2 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 a UTF8 value to Integer in R Programming - utf8ToInt() Function utf8ToInt() function in R Language is used to convert a UTF8 value to an integer value. Syntax: utf8ToInt(x, multiple) Parameters: x: Integer or integer vector multiple: Boolean value to convert into single or multiple strings Example 1: Python3 1== # R program to convert a UTF8 to Integer # Calling 1 min read Like