Description Usage Arguments Value Author(s) See Also Examples
View source: R/round.data.frame.R
Numeric elements in the data frame are rounded to the number of decimal places given by 'digits'; non-numeric elements are not changed.
1 2 | ## S3 method for class 'data.frame'
round(x, digits = 0)
|
x |
a data frame |
digits |
number of digits for rounding |
A data frame with numeric values rounded.
Mike Meredith, 4 Sept 2007
1 2 3 | x <- data.frame(a=runif(5, 0, 4), b=1:5, c=LETTERS[1:5])
x
round(x, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.