round_numeric: Function to round all numerical variables in a data frame.

View source: R/round_numeric.R

round_numericR Documentation

Function to round all numerical variables in a data frame.

Description

round_numeric is useful when many variables are contained within a data frame and all numerical values want to be rounded without individual naming.

Usage

round_numeric(df, round = 1)

factor_coerce(df)

Arguments

df

A data frame containing numeric variables.

round

Number of decimal places, used in round. Default is 1.

Author(s)

Stuart K. Grange

Examples


# Round all numeric variables to two decimal places
## Not run: 
data_tidy_round <- round_numeric(data_tidy, round = 2)

# or, make all numeric variables integers
data_tidy_integer <- round_numeric(data_tidy, round = 0)


## End(Not run)


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.