# NOT RUN {
id <- c("01", "02", "03")
age <- c("19", "20", "22")
sex <- c("f", "m", "f")
bio_date_post <- c("1991-03-23", "1991-03-16", "1991-03-16")
gluc_post <- c("5.5", "4.1", "9.7")
gluc_res_post <- c("norm", "no", "norm")
df <- data.frame(
id, age, sex,
bio_date_post,
gluc_post, gluc_res_post,
stringsAsFactors = FALSE
)
crfs <- system.file("forms", package = "dmtools")
result <- rename_dataset(df, crfs, "old_name", "new_name")
result[["data"]]
# }
Run the code above in your browser using DataLab