round.data.frame: A 'round' method for data frames.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/round.data.frame.R

Description

Numeric elements in the data frame are rounded to the number of decimal places given by 'digits'; non-numeric elements are not changed.

Usage

1
2
## S3 method for class 'data.frame'
round(x, digits = 0)

Arguments

x

a data frame

digits

number of digits for rounding

Value

A data frame with numeric values rounded.

Author(s)

Mike Meredith, 4 Sept 2007

See Also

round

Examples

1
2
3
x <- data.frame(a=runif(5, 0, 4), b=1:5, c=LETTERS[1:5])
x
round(x, 2)

mikemeredith/MMmisc documentation built on Nov. 8, 2019, 11:34 p.m.