Learn R Programming

swfscMisc (version 1.6.5)

round: Rounding Numbers for Data Frames

Description

Rounds numeric columns in data.frames

Usage

# S3 method for data.frame
ceiling(x)

# S3 method for data.frame floor(x)

# S3 method for data.frame trunc(x, ...)

# S3 method for data.frame round(x, digits = 0)

# S3 method for data.frame signif(x, digits = 6)

Arguments

x

a data.frame with numeric columns.

...

arguments to be passed to methods.

digits

integer indicating the number of decimal places (round) or significant digits (signif) to be used. See round for more details.

Author

Eric Archer eric.archer@noaa.gov

Details

Takes a data.frame and returns a data.frame with the specified function applied to each numeric column.

See Also

Round

Examples

Run this code
data(mtcars)

round(mtcars, 0)

signif(mtcars, 2)

Run the code above in your browser using DataLab