round() function in R Language is used to round off values to a specific number of decimal value.
Syntax: round(x, digits)
x: Value to be round off
digits: Number of digits to which value has to be round off
Example 1: Rounding off the values
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
Here in the above code, the value of a numeric vector is round off till 3 digits.
- Getting the Modulus of the Determinant of a Matrix in R Programming - determinant() Function
- Set or View the Graphics Palette in R Programming - palette() Function
- Get Exclusive Elements between Two Objects in R Programming - setdiff() Function
- Intersection of Two Objects in R Programming - intersect() Function
- Boxplots in R Language
- Add Leading Zeros to the Elements of a Vector in R Programming - Using paste0() and sprintf() Function
- Compute Variance and Standard Deviation of a value in R Programming - var() and sd() Function
- Compute Density of the Distribution Function in R Programming - dunif() Function
- Compute Randomly Drawn F Density in R Programming - rf() Function
- Return a Matrix with Lower Triangle as TRUE values in R Programming - lower.tri() Function
- Print the Value of an Object in R Programming - identity() Function
- Check if Two Objects are Equal in R Programming - setequal() Function
- Finding Day and Month on a Specific Date in R Language - weekday() and month() function
- Check for Presence of Common Elements between Objects in R Programming - is.element() Function
- Check if Elements of a Vector are non-empty Strings in R Programming - nzchar() Function
- Make Elements of a Vector Unique in R Programming - make.unique() Function
- Get or Set Levels of a Factor in R Programming - levels() Function
- Compute the gamma value of a Non-negative Numeric Vector in R Programming - gamma() Function
- Compute Choleski factorization of a Matrix in R Programming - chol() Function
- Histograms in R language
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.