Learn R Programming

crunch (version 1.18.0)

dichotomize: Indicate how categories represent a dichotomized value

Description

Multiple Response variables are essentially Categorical Arrays that have had a category or categories indicated as the "selected" value. These methods let you set that state.

Usage

# S4 method for Categories
is.dichotomized(x)

# S4 method for Categories,numeric dichotomize(x, i)

# S4 method for Categories,logical dichotomize(x, i)

# S4 method for Categories,character dichotomize(x, i)

# S4 method for Categories undichotomize(x)

# S4 method for CategoricalVariable,ANY dichotomize(x, i)

# S4 method for CategoricalArrayVariable,ANY dichotomize(x, i)

# S4 method for CategoricalVariable undichotomize(x)

# S4 method for CategoricalArrayVariable undichotomize(x)

Arguments

x

Categories or a Variable subclass that has Categories

i

For the dichotomize methods, the numeric or logical indices of the categories to mark as "selected", or if character, the Category "names". Note that unlike some other categorical variable methods, numeric indices are positional, not with reference to category ids.

Value

Categories or the Variable, (un)dichotomized accoringly

Details

dichotomize lets you specify which categories are "selected", while undichotomize strips that selection information. Dichotomize converts a Categorical Array to a Multiple Response, and undichotomize converts back.

See Also

describe-category