Functions to Merge and Recode Across Multiple Variables
The package currently contains the following functions:
mcode
Take several vectors as input and recode them into a single resulting vector according to a specified recoding pattern.
branch
Take a vector as input and convert it into a matrix of vectors based on a branching (grouping) factor.
unbranch
Take several vectors as input and convert them into a single, merged vector that combines across the input values, ignoring zero values by default (thus providing a reverse of branch
).
mergeNA
A wrapper for unbranch
that modifies default arguments to unbranch(..., .ignore = NA, .fill = NA)
.
Thomas J. Leeper <thosjleeper@gmail.com>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.