round Function in R (2 Examples)
This article explains how to round numeric data with the round function in the R programming language.
Example Data
x <- 3.71463 # Create numeric data object |
x <- 3.71463 # Create numeric data object
Example 1: Default Application of round Function
round(x) # Apply round function # 4 |
round(x) # Apply round function # 4
Example 2: Modify Decimal Places of round Function
round(x, 3) # Specify number of decimal places # 3.715 |
round(x, 3) # Specify number of decimal places # 3.715