Learn R Programming

PKPDmisc (version 2.1.2)

round_columns: round columns

Description

round columns

Usage

round_columns(df, col_list)

Arguments

df

data frame

col_list

list of vectors of columns and number of digits to round each

Details

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

Examples

Run this code
# 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)
# }

Run the code above in your browser using DataLab