varN_fctr_reorder | R Documentation |
Function to that looks for VARN counterparts to any character or factor VAR variables in any dataframe and re-orders there factor levels, taking the lead from VARN's numeric guide.
varN_fctr_reorder(data)
data |
a dataframe, including one enriched with SAS labels attributes |
The data frame after having factor levels re-ordered by VARN
data(adae, package = "tidyCDISC")
varN_fctr_adae <- varN_fctr_reorder(adae)
unique(adae[,c("AGEGR1", "AGEGR1N")])
levels(adae$AGEGR1)
levels(varN_fctr_adae$AGEGR1)
unique(adae[,c("RACE", "RACEN")])
levels(adae$RACE)
levels(varN_fctr_adae$RACE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.