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

Example 1: Default Application of round Function

round(x)         # Apply round function
# 4

Example 2: Modify Decimal Places of round Function

round(x, 3)      # Specify number of decimal places
# 3.715

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top