varToFactor | R Documentation |
sdcMicroObj-class
from Numeric to
Factor or from Factor to NumericChange the scale of a variable
varToFactor(obj, var)
varToNumeric(obj, var)
obj |
object of class |
var |
name of the keyVariable to change |
the modified sdcMicroObj-class
## for objects of class sdcMicro:
data(testdata2)
sdc <- createSdcObj(testdata2,
keyVars=c('urbrur','roof','walls','water','electcon','relat','sex'),
numVars=c('expend','income','savings'), w='sampling_weight')
sdc <- varToFactor(sdc, var="urbrur")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.