The PivotCalculation class defines one calculation in a pivot table.
PivotCalculationObject of R6Class with properties and methods that
  define a single pivot table calculation.
R6Class object.
parentPivotOwning pivot table.
calculationNameCalculation unique name. Recommendation: Do not have spaces in this name.
captionCalculation display name - i.e. the name shown in the pivot table.
visibleShow or hide the calculation. Hidden calculations are typically used as base values for other calculations.
displayOrderThe order the calculations are displayed in the pivot table.
filtersAny data filters specific to this calculation. A PivotFilters object.
formatA character, list or custom function to format the calculation result.
dataNameSpecifies which data frame in the pivot table is used for this calculation.
typeThe calculation type: "summary", "calculation", "function" or "value".
valueNameFor type="value", the name of the column containing the value to display in the pivot table.
summariseExpressionFor type="summary", either the dplyr expression to use with dplyr::summarise() or a data.table calculation expression.
calculationExpressionFor type="calculation", an expression to combine aggregate values.
calculationFunctionFor type="function", a reference to a custom R function that will carry out the calculation.
basedOnA character vector specifying the names of one or more calculations that this calculation depends on.
noDataValueAn integer or numeric value specifying the value to use if no data exists for a particular cell.
noDataCaptionA character value that will be displayed by the pivot table if no data exists for a particular cell.
For more complete explanations and examples please see the extensive vignettes supplied with this package.
new(...)Create a new pivot calculation, specifying the field values documented above.
asList()Get a list representation of this calculation.
asJSON()Get a JSON representation of this calculation.
asString()Get a text representation of this calculation.
# NOT RUN {
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.
# }
Run the code above in your browser using DataLab