Learn R Programming

pivottabler (version 0.4.0)

PivotFilter: A class that defines a filter condition.

Description

The PivotFilter class represents a single filter condition. The condition relates to one column and is of the form [ColumnName] IN c(Value1, Value2, Value3, ...). Often in a pivot table, each filter specifies only one data value, as typically each distinct data value exists in a separate row or column.

Usage

PivotFilter

Arguments

Value

Object of R6Class with properties and methods that define a single pivot table filter.

Format

R6Class object.

Fields

parentPivot

Owning pivot table.

variableName

The name of the column in the data frame that this filter will apply to.

values

A single data value or a vector of data values that could/can be found in the data frame column.

Methods

Documentation

For more complete explanations and examples please see the extensive vignettes supplied with this package.

new(...)

Create a new pivot filter, specifying the field values documented above.

and(filter)

Update this PivotFilter by ANDing this filter with the specified PivotFilter.

or(filter)

Update this PivotFilter by ORing filter with the specified PivotFilter.

replace(filter)

Update this PivotFilter by setting this filter to match the specified PivotFilter.

getCopy()

Get a copy of this PivotFilter.

asList()

Get a list representation of this PivotFilter.

asJSON()

Get a list representation of this PivotFilter.

asString(includeVariableName=TRUE, seperator=" ")

Get a text representation of this PivotFilter.

Examples

Run this code
# NOT RUN {
pt <- PivotTable$new()
# ...
PivotFilter$new(pt, variableName="Country", values="England")
# }

Run the code above in your browser using DataLab