The `PivotBatch` class represents one combination of data, variables and calculations that are needed when calculating the values of cells in a pivot table.
R6Class object.
The combination of data name and variable names defines a batch. When the batch is calculated, the calculations specified in the batch are evaluated against the specified data, with the data being grouped by the variables specified in the batch. Individual result values can then be retrieved from the batch. See the "Performance" vignette for details.
batchIdThe unique identifier for the batch.
batchNameThe unique name of the batch.
compatibleCountThe number of pivot cell calculations that this batch supports.
evaluatedTRUE if this batch has been evaluated.
resultsThe results (a data frame) of the evaluation of the batch
asStringA text description of the batch.
new()Create a new `PivotBatch` object.
PivotBatch$new(
parentPivot = NULL,
batchId = 0,
dataName = NULL,
variableNames = NULL,
values = NULL,
calculationName = NULL,
calculationGroupName = NULL
)parentPivotThe pivot table that this `PivotBatch` instance belongs to.
batchIdThe unique identifier for the batch.
dataNameThe name of the data frame (as specified in `pt$addData()`) that this batch relates to.
variableNamesSpecifies the combination of variable names (i.e. dimensionality) of the batch.
valuesA list specifying the distinct list of values for each variable, i.e. `list(varName1=values1, varName2=values2, ...)`. `values` is not currently used and does not affect the batch compatibility logic.
calculationNameThe first calculation added to this batch. Does not affect the batch compatibility logic.
calculationGroupNameThe calculation group of the first calculation added to this batch. Does not affect the batch compatibility logic.
isCompatible()Determine whether a combination of data and variables is compatible with this batch.
addCompatible()Add a new set of values or a new calculation to the batch. with this batch.
PivotBatch$addCompatible(
values = NULL,
calculationName = NULL,
calculationGroupName = NULL
)valuesA list specifying the distinct list of values for each variable, i.e. `list(varName1=values1, varName2=values2, ...)`. `values` is not currently used and does not affect the batch compatibility logic.
calculationNameThe calculation to add to the batch. Does not affect the batch compatibility logic.
calculationGroupNameThe calculation group of the calculation to add to the batch. Does not affect the batch compatibility logic.
getCalculationInternalName()Find the internal name of a calculation in the batch.
getSummaryValueFromBatch()Retrieve one calculation value from the batch, typically for the value of one cell in a pivot table.
PivotBatch$getSummaryValueFromBatch(
filters = NULL,
calculationName = NULL,
calculationGroupName = NULL
)filtersA `PivotFilters` instance that specifies which value to retrieve. This filters object is a combination of the row, column and calculation filters.
calculationNameThe name of the calculation value to retrieve.
calculationGroupNameThe calculation group of the calculation to retrieve.
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.