The `PivotCell` class represents a cell in the body of a pivot table (i.e. not a row/column heading, rather a cell typically containing a numerical value).
R6Class
object.
instanceId
An integer value that uniquely identifies this cell. NB: This number is guaranteed to be unique within the pivot table, but the method of generation of the values may change in future, so you are advised not to base any logic on specific values.
rowNumber
The row number of the cell. 1 = the first (i.e. top) data row.
columnNumber
The column number of the cell. 1 = the first (i.e. leftmost) data column.
calculationName
The name of the calculation that is displayed in the cell.
calculationGroupName
The name of the calculation group that owns the calculation.
isEmpty
`TRUE` if this cell contains no data (e.g. if it is part of a header / outline row), `FALSE` otherwise.
rowFilters
A `PivotFilters` object containing the filters applied to this cell from the row data groups (i.e. row headings).
columnFilters
A `PivotFilters` object containing the filters applied to this cell from the column data groups (i.e. column headings).
rowColFilters
A `PivotFilters` object containing the combined filters applied to this cell from both the row and column data groups.
calculationFilters
The set of filters that apply to this cell to support calculation logic. Either a `PivotFilters` object or a `PivotFilterOverrides` object. See the "Appendix: Calculations" vignette for details.
workingData
A list of filter objects that results when the `rowColFilters` and `calculationFilters` are combined prior to calculating the cell value. This is a list since some cells involve multiple calculations - where `calc$type` is "calculation" or "function", the calculation can be based on the values of other calculations.
evaluationFilters
The same as `workingData` generally, except when custom calculation functions modify the filters whilst executing.
rowLeafGroup
The row data group linked to this row.
columnLeafGroup
The column data group linked to this column.
isTotal
`TRUE` is this cell is a total, `FALSE` otherwise-
rawValue
The raw cell value - i.e. unformatted, typically a numeric value.
formattedValue
The formatted value - typically a character value.
baseStyleName
The name of the style that defines the visual appearance of the cell.
style
A `PivotStyle` object that assists in managing the CSS style declarations that override the base style.
new()
Create a new `PivotCell` object.
PivotCell$new(
parentPivot,
rowNumber = NULL,
columnNumber = NULL,
calculationName = NULL,
calculationGroupName = NULL,
isEmpty = FALSE,
rowFilters = NULL,
columnFilters = NULL,
rowColFilters = NULL,
rowLeafGroup = NULL,
columnLeafGroup = NULL
)
parentPivot
The pivot table that this `PivotCell` instance belongs to.
rowNumber
The row number of the cell. 1 = the first (i.e. top) data row.
columnNumber
The column number of the cell. 1 = the first (i.e. leftmost) data column.
calculationName
The name of the calculation that is displayed in the cell.
calculationGroupName
The name of the calculation group that owns the calculation.
isEmpty
`TRUE` if this cell contains no data (e.g. if it is part of a header / outline row), `FALSE` otherwise.
rowFilters
A `PivotFilters` object containing the filters applied to this cell from the row data groups (i.e. row headings).
columnFilters
A `PivotFilters` object containing the filters applied to this cell from the column data groups (i.e. column headings).
rowColFilters
A `PivotFilters` object containing the combined filters applied to this cell from both the row and column data groups.
rowLeafGroup
The row data group linked to this row.
columnLeafGroup
The column data group linked to this column.
setStyling()
An internal method used to set style declarations on the cell. Using `pt$setStyling(cells=x)` is preferred for users.
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.