Description Usage Arguments Value Examples
this function uses topcode.var
to topcode a set of variables.
it's useful for topcoding a whole set of aggregated relational data
("how many X are you connected to?") questions in the same way.
1 | topcode.data(survey.data, vars, max, to.na = NULL, ignore = NA)
|
survey.data |
the dataset with the survey responses |
vars |
a vector with the names or indices of the columns in the dataframe that are to be topcoded |
max |
the maximum value; all values > max are recoded to max |
to.na |
a vector of values to recode to NA (this happens before topcoding) |
ignore |
a vector of values to leave unchanged |
the topcoded vector
1 2 3 4 5 6 7 | ## Not run:
data(hh.survey) # example data included with the package
example.survey <- topcode.data(example.survey,
vars=known.popn.vars,
max=30)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.