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.
instanceIdAn 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.
rowNumberThe row number of the cell. 1 = the first (i.e. top) data row.
columnNumberThe column number of the cell. 1 = the first (i.e. leftmost) data column.
calculationNameThe name of the calculation that is displayed in the cell.
calculationGroupNameThe 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.
rowFiltersA `PivotFilters` object containing the filters applied to this cell from the row data groups (i.e. row headings).
columnFiltersA `PivotFilters` object containing the filters applied to this cell from the column data groups (i.e. column headings).
rowColFiltersA `PivotFilters` object containing the combined filters applied to this cell from both the row and column data groups.
calculationFiltersThe 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.
workingDataA 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.
evaluationFiltersThe same as `workingData` generally, except when custom calculation functions modify the filters whilst executing.
rowLeafGroupThe row data group linked to this row.
columnLeafGroupThe column data group linked to this column.
isTotal`TRUE` is this cell is a total, `FALSE` otherwise-
rawValueThe raw cell value - i.e. unformatted, typically a numeric value.
formattedValueThe formatted value - typically a character value.
baseStyleNameThe name of the style that defines the visual appearance of the cell.
styleA `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
)parentPivotThe pivot table that this `PivotCell` instance belongs to.
rowNumberThe row number of the cell. 1 = the first (i.e. top) data row.
columnNumberThe column number of the cell. 1 = the first (i.e. leftmost) data column.
calculationNameThe name of the calculation that is displayed in the cell.
calculationGroupNameThe 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.
rowFiltersA `PivotFilters` object containing the filters applied to this cell from the row data groups (i.e. row headings).
columnFiltersA `PivotFilters` object containing the filters applied to this cell from the column data groups (i.e. column headings).
rowColFiltersA `PivotFilters` object containing the combined filters applied to this cell from both the row and column data groups.
rowLeafGroupThe row data group linked to this row.
columnLeafGroupThe 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.