Usage
makeArray(subvariables, dataset = NULL, pattern = NULL, key = namekey(dataset), name, ...)
makeMR(subvariables, dataset = NULL, pattern = NULL, key = namekey(dataset), name, selections, ...)
Arguments
subvariables
a list of Variable objects to bind together, or a
Dataset object containing only the Variables to bind (as in from subsetting
a Dataset), or values (e.g. names) of variables corresponding to key
.
If omitted, must supply dataset
and pattern
. If specifying
values, must include dataset
.
dataset
the Crunch Dataset to which the variables in
subvariables
belong, or in which to search for variables based
on pattern
. If omitted, subvariables
must exist and all
Variables in the list must belong to the same Dataset
pattern
An optional regular expression to search for variables to
bind within dataset
.
Note that this argument is deprecated. If you wish to grep, you can
grep(pattern, aliases(variables(dataset)))
or similar outside this
function.
key
character, the name of the Variable field in which to search
with pattern
. Default is 'alias'.
name
character, the name that the new Categorical Array variable
should have. Required.
...
Optional additional attributes to set on the new variable.
selections
character, for makeMR
, the names of the
categories to mark as the dichotomous selections. Required for
makeMR
; ignored in makeArray
.