mrset {expss} | R Documentation |
Create multiple response set/multiple dichotomy set from variables
Description
These functions are intended for usage with tables - tables,
cross_cpct, cross_fun. Result of mrset
is considered as
muliple-response set with category encoding and result of mdset
is
considered as multiple response set with dichotomy (dummy) encoding e. g.
with 0 or 1 in the each column. Each column in the dichotomy
is
indicator of absence or presence of particular feature. Both functions don't
convert its arguments to anything - it is supposed that arguments already
have appropriate encoding. For conversation see as.dichotomy or
as.category.
mrset_f
andmdset_f
select variables by fixed pattern. Fixed pattern can be unquoted. For details see ..f.mrset_p
andmdset_p
select variables for multiple-responses by perl-style regular expresssion. For details see ..p.mrset_t
andmdset_t
select variables by expanding text arguments. For details see ..t and text_expand.
Usage
mrset(..., label = NULL)
mdset(..., label = NULL)
mrset_f(..., label = NULL)
mdset_f(..., label = NULL)
mrset_p(..., label = NULL)
mdset_p(..., label = NULL)
mrset_t(..., label = NULL)
mdset_t(..., label = NULL)
Arguments
... |
variables |
label |
character optional label for multiple response set |
Value
data.frame of class category
/dichotomy
See Also
Examples
data.table::setDTthreads(2)
data(product_test)
cross_cpct(product_test, mrset(a1_1 %to% a1_6))
# same result
cross_cpct(product_test, mrset_f(a1_))
# same result
cross_cpct(product_test, mrset_p("a1_"))
# same result
cross_cpct(product_test, mrset_t("a1_{1:6}"))