View source: R/e_REDCap_use_dotfactor_var.R
e_REDCap_use_dotfactor_var | R Documentation |
For the factor (categorical) variables, the non-".factor" variable name is a numeric class with the levels (and a variable label) while the ".factor" variable name is a factor class with the labels in the appropriate order (and no variable label). This function copies the variable label from the non-".factor" variable name to the ".factor" variable, then copies the ".factor" variable to the non-".factor" variable name. This makes the non-".factor" variable name have all the best attributes. Finally, drop all the ".factor" variables from the data.
e_REDCap_use_dotfactor_var(dat, var_names = NULL, sw_all_dotfactor = TRUE)
dat |
data.frame file to process |
var_names |
non-".factor" variable names to update |
sw_all_dotfactor |
T/F to process all ".factor" variables |
dat with updated non-".factor" variables
## Not run:
# dat_temp <-
# e_REDCap_use_dotfactor_var(
# var_names = c("labs_bun_hl", "labs_cr_hl", "labs_elec_na_hl")
# , dat = dat_vci
# )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.