manageSimPopObj | R Documentation |
simPopObj
.This functions allows to get or set variables in slots pop
and
sample
of simPopObj
-objects. This is a utility
function that is useful for writing custom wrapper functions.
manageSimPopObj(x, var, sample = FALSE, set = FALSE, values = NULL)
x |
an object of class |
var |
character vector of length 1; variable name that should be set or extracted. |
sample |
a logical indicating whether |
set |
logical; if TRUE, argument 'values' is set to either the sample or population data stored in 'x', depending on argument 'sample'. If FALSE, the desired variable given by 'var' is returned from either the sample or the pop slot of 'x'. |
values |
vector; if 'set' is TRUE, then this vector is used to update the variable of sample or population data depending of choice of argument 'sample'. |
An object of class simPopObj
(if 'set' is TRUE)
or a vector (if 'set' is FALSE).
Bernhard Meindl and Matthias Templ
data(eusilcS) inp <- specifyInput(data=eusilcS, hhid="db030", hhsize="hsize", strata="db040", weight="db090") simPopObj <- simStructure(data=inp, method="direct", basicHHvars=c("age", "rb090")) (manageSimPopObj(simPopObj, var="age", sample=FALSE, set=FALSE)) (manageSimPopObj(simPopObj, var="age", sample=TRUE, set=FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.