R: Rounding Numbers for Data Frames

round {swfscMisc} | R Documentation

## Rounding Numbers for Data Frames

### Description

Rounds numeric columns in data.frames

### Usage

    ## S3 method for class 'data.frame'
    ceiling(x)

    ## S3 method for class 'data.frame'
    floor(x)

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

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

    ## S3 method for class '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.

### Details

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

### Author(s)

Eric Archer eric.archer@noaa.gov

### See Also

`Round`

### Examples

    data(mtcars)

    round(mtcars, 0)

    signif(mtcars, 2)

[Package swfscMisc version 1.2 Index]