Description Usage Arguments Value Author(s) Examples
this function is similar to R function relevel
,
but in addition addes numbering to the levels so that
they are displayed in the right order when creating
cross-tables.
1 | ji.changerefgroup.ds(xvect, ref = NULL)
|
xvect |
a factor |
ref |
the reference level |
a factor of the same length as xvect
Isaeva, J.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# load the login data
data(logindata)
# login and assign specific variable(s)
myvar <- list("PM_BMI_CATEGORICAL")
library(opal)
opals <- datashield.login(logins=logindata,assign=TRUE,variables=myvar)
# rename the levels of PM_BMI_CATEGORICAL and make "obesity" as a reference level
datashield.assign(opals, 'bmi_new', quote(ji.recodelevels.ds(D$PM_BMI_CATEGORICAL, newlabels=c('normal', 'overweight', 'obesity'))))
datashield.assign(opals, 'bmi_ob', quote(ji.changerefgroup.ds(bmi_new, ref='obesity')))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.