Insertions-class {crunch}R Documentation

Insert categories in transformations

Description

Insertions allow you to insert new categories into a categorical-like response on a variable's transformations.

Usage

Insertions(..., data = NULL)

Insertion(...)

.Insertion(..., data = NULL)

anchor(x, ...)

anchors(x)

anchor(x) <- value

arguments(x, ...)

arguments(x) <- value

func(x)

funcs(x)

## S4 replacement method for signature 'Insertion'
anchor(x) <- value

## S4 replacement method for signature 'Subtotal'
anchor(x) <- value

## S4 replacement method for signature 'Heading'
anchor(x) <- value

## S4 replacement method for signature 'SummaryStat'
anchor(x) <- value

## S4 replacement method for signature 'Insertion,ANY'
subtotals(x) <- value

## S4 replacement method for signature 'Insertion'
arguments(x) <- value

## S4 replacement method for signature 'Subtotal'
arguments(x) <- value

## S4 replacement method for signature 'Heading'
arguments(x) <- value

## S4 replacement method for signature 'SummaryStat'
arguments(x) <- value

## S4 method for signature 'Insertion'
arguments(x)

## S4 method for signature 'Subtotal'
arguments(x, var_items)

## S4 method for signature 'Heading'
arguments(x)

## S4 method for signature 'SummaryStat'
arguments(x, var_items)

## S4 method for signature 'Insertion'
anchor(x, ...)

## S4 method for signature 'Subtotal'
anchor(x, var_items)

## S4 method for signature 'Heading'
anchor(x, var_items)

## S4 method for signature 'SummaryStat'
anchor(x, var_items)

## S4 method for signature 'Insertion'
func(x)

## S4 method for signature 'Subtotal'
func(x)

## S4 method for signature 'Heading'
func(x)

## S4 method for signature 'SummaryStat'
func(x)

## S4 method for signature 'Insertions'
anchors(x)

## S4 method for signature 'Insertions'
funcs(x)

Arguments

...

additional arguments to [, ignored

data

For the constructor functions Insertion and Insertions, you can either pass in attributes via ... or you can create the objects with a fully defined list representation of the objects via the data argument. See the examples.

x

For the attribute getters and setters, an object of class Insertion or Insertions

value

For ⁠[<-⁠, the replacement Insertion to insert

var_items

categories (from categories()) or subvariables (from subvariables() to used by the arguments and anchor methods when needed to translate between category/subvariable names and category ids/aliases.

Working with Insertions

Insertions are used to add information about a variable or CrunchCube that extends the data in the dataset but does not alter it. This new data includes: aggregations like subtotals that sum the count of more than on category together or headings which can be added between categories.

Insertions objects are containers for individual Insertion objects. The individual Insertions contain all the information needed to calculate, apply, and display insertions to CrunchCubes and categorical variables.

An Insertion must have two properties:

Additionally, Insertions may also have the following two properties (though if they have one, they must have the other):

Although it is possible to make both subtotals and headings using Insertion alone, it is much easier and safer to use the functions Subtotal() and Heading() instead. Not only are they more transparent, they also are quicker to type, accept both category names as well as ids, and have easier to remember argument names.


[Package crunch version 1.30.1 Index]