round_cols | R Documentation |
round_cols
will round values in a pre-defined selection of columns in a dataset.
round_cols(data, col_list, dec = 2)
data |
A data object. |
col_list |
A character vector of specific column names to round. |
dec |
A numeric value to control precision of rounding. |
The function is vectorized so that multiple inputs can be examined without having to define any specific loops.
A new dataset object with select columns rounded.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.