ji.ds.asFactor: Turns a vector into factor type

Description Usage Arguments Value Author(s) Examples

Description

This function is similar to R function as.factor.

Usage

1
2
  ji.ds.asFactor(datasources = NULL, xvect = NULL,
    newobj = NULL)

Arguments

datasources

a list of opal object(s) obtained after login in to opal servers; these objects hold also the data assign to R, as dataframe, from opal datasources.

xvect

a vector.

newobj

the name of the new vector.If this argument is set to NULL, the name of the new variable is the name of the input variable with the suffixe '_factor' (e.g. 'GENDER_factor', if input variable's name is 'GENDER')

Value

a message is displayed when the action is completed.

Author(s)

Gaye, A. (amadou.gaye

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{

# load that contains the login details
data(logindata)

# login and assign specific variable(s)
myvar <- list("GENDER") # ?????????????????????????????????????????????????????????????????????????????? another variable??????????????????
opals <- datashield.login(logins=logindata,assign=TRUE,variables=myvar)

# turn the factor variable 'GENDER' into a character vector
ji.ds.asFactor(datasources=opals, xvect=quote(D$GENDER), newobj="gender_as_factor")
}

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