View source: R/round_columns.R
round_columns | R Documentation |
round columns
round_columns(df, col_list)
df |
data frame |
col_list |
list of vectors of columns and number of digits to round each |
col_list should contain a list of list tuples, where the first element is a vector of column names to round, and the second value should be the number of digits to round to
## Not run: col_list <- list( list("AGE", 1), list(c("WEIGHT", "SCREATININE", "SERUMALT", "DELDBP", "DELSBP"), 2) ) aht_trial_rounded <- round_columns(aht_trial2, col_list) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.