Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Subvariables

Subvariables in Array Variables


Description

Multiple-response and categorical-array variables are higher order variables which are made up of sets of subvariables. These methods allow you to retrieve and change the subvariables of a multiple-response or categorical-array variable.

Usage

subvariables(x)

subvariables(x) <- value

## S4 method for signature 'ArrayVariable'
subvariables(x)

## S4 method for signature 'CrunchVariable'
subvariables(x)

## S4 method for signature 'VariableTuple'
subvariables(x)

## S4 replacement method for signature 'ArrayVariable,ANY'
subvariables(x) <- value

## S4 replacement method for signature 'ArrayVariable,Subvariables'
subvariables(x) <- value

Arguments

x

A Variable or Subvariables object

value

For the setters, the appropriate values to set

Details

Subvariables can be accessed from array variables (including multiple response) with the subvariables method. They can be assigned back with the subvariables<- setter, but there are limitations to what is supported. Specifically, you can reorder subvariables, but you cannot add or remove subvariables by subvariables<- assignment. See deleteSubvariable to remove subvariables from an array.

Subvariables have a names attribute that can be accessed, showing the display names of the subvariables. These can be set with the names<- method.

Finally, subvariables can be accessed as regular (categorical) variables with the $ and [[ extract methods.

See the vignette on array variables for further details and examples.

See Also

describe-catalog deleteSubvariable vignette("array-variables", package="crunch")


crunch

Crunch.io Data Tools

v1.28.0
LGPL (>= 3)
Authors
Greg Freedman Ellis [aut, cre], Jonathan Keane [aut], Mike Malecki [aut], Neal Richardson [aut], Gordon Shotwell [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.