The round() function in R has a parameter "digits" to specify the number of decimal places. The default value of the parameter is 0, and hence it returns the nearest integer. You can set this parameter according to your requirement.
Here is an example to show how to use this parameter:
> round(12.5643435, digits = 2)[1] 12.56> round(12.5643435, digits = 3)[1] 12.564
> round(12.5643435, digits = 2)
[1] 12.56
> round(12.5643435, digits = 3)
[1] 12.564