createSubvarDeriv | R Documentation |
This function creates a single subvariable definition based on a character string to search for and an originating variable. It uses regex to determine whether a string is present in a delimited list, then substitutes the user supplied values to indicate selection, non-selection, and missingness.
createSubvarDeriv(var, str, delim, selected, not_selected, unanswered)
var |
The variable containing the delimited responses |
str |
A string whose presence indicates a selection |
delim |
The delimiter separating the responses |
selected |
A character string used to indicate a selection, defaults to "selected" |
not_selected |
Character string identifying non-selection, defaults to "not_selected" |
unanswered |
Character string indicating non-response, defaults to NA. |
A VariableDefinition
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.