This function will create a set of n binary variables to indicate the presence or absence of a each element of a user-defined vector of n strings, where the string of interest may appear in one or more data.frame columns.
1 | makeBinVars(codes, dfCols, data, key, outName = "newBinVars")
|
codes |
A character vector of the codes of interest. |
dfCols |
Either a character vector reflecting the names of data columns to look through for x, or a numeric vector of column indices. |
data |
A dataframe containing individual claims-level data. |
key |
Either a character vector or column indices to indicate the unique key necessary to allow for merging back to original dataset. |
outName |
Name for the list object given as output of this function. "newBinVars" will be applied as default unless another string is given. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.