round_cols: Round values in select columns

round_colsR Documentation

Round values in select columns

Description

round_cols will round values in a pre-defined selection of columns in a dataset.

Usage

round_cols(data, col_list, dec = 2)

Arguments

data

A data object.

col_list

A character vector of specific column names to round.

dec

A numeric value to control precision of rounding.

Details

The function is vectorized so that multiple inputs can be examined without having to define any specific loops.

Value

A new dataset object with select columns rounded.

Examples

tempData <- data.frame(rate = as.numeric(c(10.344, 0.359 , 1023.49)), value = as.numeric(c(10, 1000, 3200.2)))
round_cols(tempData, c('rate'), 2)


al-obrien/farrago documentation built on April 14, 2023, 6:20 p.m.