recode_vrs | R Documentation |
Recode variables and their values based on a data dictionary
recode_vrs(data, data_dictionary, vrs = NULL, factor = FALSE)
data |
A data frame with raw data. |
data_dictionary |
A data dictionary containing labels for variables and their values. |
vrs |
A character vector specifying variables of which the values need to be recoded. |
factor |
A logical to indicate whether recoded variables need to be converted into ordered factors. |
The input data frame with recoded and labelled variables.
if (FALSE) {
library(phdcocktail)
data(ibd_data1, package = "phdcocktail")
ibd_data_recoded <- recode_vrs(
data = ibd_data1, data_dictionary = ibd_data_dict,
vrs = c("disease_location", "disease_behaviour", "gender"), factor = TRUE
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.