Learn R Programming

socviz (version 2.0.0)

round_df: round_df

Description

Round numeric columns of a data frame or tibble

Usage

round_df(data, dig = 2)

Value

An object of the same class as `data`, with the numeric columns rounded off to `dig`

Arguments

data

A data frame or tibble

dig

The number of digits to round to

Author

Kieran Healy

Details

Takes a data frame or tibble as input, rounds the numeric columns to the specified number of digits.

Examples

Run this code
head(round_df(iris, 0))

Run the code above in your browser using DataLab