createSubvarDeriv {crunch} | R Documentation |
Create subvariable derivation expressions
Description
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.
Usage
createSubvarDeriv(var, str, delim, selected, not_selected, unanswered)
Arguments
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. |
Value
A VariableDefinition
[Package crunch version 1.31.0 Index]