ji.recodelevels.ds: recodes a categorical variable

Description Usage Arguments Value Author(s) Examples

Description

this function recodes levels of a categorical variable with new given labels.

Usage

1
  ji.recodelevels.ds(xvect, newlabels = NULL)

Arguments

xvect

a factor

newlabels

a string vector with new labels for the levels If newlabels is not specified, the naming of original levels is amended - numbering is added (0_..., 1_..., 2_... etc.)

Value

a factor vector with new labels for levels

Author(s)

Isaeva, J.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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
datashield.assign(opals, 'bmi_new', quote(ji.recodelevels.ds(D$PM_BMI_CATEGORICAL, newlabels=c('normal', 'overweight', 'obesity'))))

## End(Not run)

datashield/ji.dev.sv documentation built on May 14, 2019, 7:53 p.m.