topcode.data: topcode a group of variables

Description Usage Arguments Value Examples

Description

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.

Usage

1
topcode.data(survey.data, vars, max, to.na = NULL, ignore = NA)

Arguments

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

Value

the topcoded vector

Examples

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)

networkreporting documentation built on May 2, 2019, 1:52 p.m.