Description Usage Arguments Value Author(s) Examples
The functions uses the input vector to generate a factor vector. The generate factor is checked and if valid (no category with count > 0 and < 5) returned; if not valid an empty of the same length is returned.
1 2 | ag.createfactor.ds(xvect, levels = NULL, labels = levels,
exclude = NA, ordered = is.ordered(xvect))
|
xvect |
a numerical or character vector |
levels |
optional vector of values that 'xvect' might have taken |
labels |
labels for the different levels |
exclude |
values to be excluded |
ordered |
tells if the variable 'x' is ordered |
a 'valid' factor vector or an empty vector of the same length.
Gaye, A.; Burton, P.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# load the login data
data(logindata)
# login and assign specific variable(s)
myvar <- list("GENDER")
opals <- ag.ds.login(logins=logindata,assign=TRUE,variables=myvar)
# generate a factor vector using the variable 'GENDER'
datashield.assign(opals, "sex", quote(ag.createfactor.ds(D$GENDER)))
# display the number of observation in each vector
datashield.aggregate(opals, quote(length(sex)))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.