PivotCalculationGroup | R Documentation |
The 'PivotCalculationGroup' class is a container for multiple 'PivotCalculation' objects. Every pivot table has at least one pivot calculation group and this is sufficient for all regular pivot tables. Additional calculation groups are typically only created for irregular/custom pivot tables. See the "Irregular Layout" vignette for an example.
R6Class
object.
calculationGroupName
The name of the calculation group.
defaultCalculationName
The name of the default calculation in this calculation group.
count
The number of calculations in this calculation group.
calculations
A list containing the calculations in this group.
visibleCount
The number of visible calculations in this calculation group.
visibleCalculations
A list containing the visible calculations in this group.
new()
Create a new 'PivotCalculationGroup' object.
PivotCalculationGroup$new(parentPivot, calculationGroupName = NULL)
parentPivot
The pivot table that this 'PivotCalculationGroup' instance belongs to.
calculationGroupName
Calculation group unique name. Recommendation: Do not have spaces in this name.
A new 'PivotCalculationGroup' object.
isExistingCalculation()
Check whether a calculation already exists in this calculation group.
PivotCalculationGroup$isExistingCalculation(calculationName = NULL)
calculationName
group unique name.
'TRUE' if a calculation with the specified name exists in this calculation group object, 'FALSE' otherwise.
item()
Retrieve a calculation by index.
PivotCalculationGroup$item(index)
index
An integer specifying the calculation to retrieve.
The calculation that exists at the specified index.
getCalculation()
Retrieve a calculation by name.
PivotCalculationGroup$getCalculation(calculationName = NULL)
calculationName
The name of the calculation to retrieve.
The calculation with the specified name.
defineCalculation()
Create a new 'PivotCalculation' object.
PivotCalculationGroup$defineCalculation( calculationName = NULL, caption = NULL, visible = TRUE, displayOrder = NULL, filters = NULL, format = NULL, fmtFuncArgs = NULL, dataName = NULL, type = "summary", valueName = NULL, summariseExpression = NULL, calculationExpression = NULL, calculationFunction = NULL, calcFuncArgs = NULL, basedOn = NULL, noDataValue = NULL, noDataCaption = NULL, headingBaseStyleName = NULL, headingStyleDeclarations = NULL, cellBaseStyleName = NULL, cellStyleDeclarations = NULL )
calculationName
Calculation unique name.
caption
Calculation display name
visible
'TRUE' to show the calculation in the pivot table or 'FALSE' to hide it. Hidden calculations are typically used as base values for other calculations.
displayOrder
The order the calculations are displayed in the pivot table.
filters
Any additional data filters specific to this calculation. This can be a 'PivotFilters' object that further restricts the data for the calculation or a list of individual 'PivotFilter' objects that provide more flexibility (and/or/replace). See the Calculations vignette for details.
format
A character, list or custom function to format the calculation result.
fmtFuncArgs
A list that specifies any additional arguments to pass to a custom format function.
dataName
Specifies which data frame in the pivot table is used for this calculation (as specified in 'pt$addData()').
type
The calculation type: "summary", "calculation", "function" or "value".
valueName
For type="value", the name of the column containing the value to display in the pivot table.
summariseExpression
For type="summary", either the dplyr expression to use with dplyr::summarise() or a data.table calculation expression.
calculationExpression
For type="calculation", an expression to combine aggregate values.
calculationFunction
For type="function", a reference to a custom R function that will carry out the calculation.
calcFuncArgs
For type="function", a list that specifies additional arguments to pass to calculationFunction.
basedOn
A character vector specifying the names of one or more calculations that this calculation depends on.
noDataValue
An integer or numeric value specifying the value to use if no data exists for a particular cell.
noDataCaption
A character value that will be displayed by the pivot table if no data exists for a particular cell.
headingBaseStyleName
The name of a style defined in the pivot table to use as the base styling for the data group heading.
headingStyleDeclarations
A list of CSS style declarations (e.g. 'list("font-weight"="bold")') to override the base style.
cellBaseStyleName
The name of a style defined in the pivot table to use as the base styling for the cells related to this calculation.
cellStyleDeclarations
A list of CSS style declarations (e.g. 'list("font-weight"="bold")') to override the base style.
A new 'PivotCalculation' object.
asList()
Return the contents of this object as a list for debugging.
PivotCalculationGroup$asList()
A list of various object properties.
asJSON()
Return the contents of this object as JSON for debugging.
PivotCalculationGroup$asJSON()
A JSON representation of various object properties.
asString()
Return a representation of this object as a character value.
PivotCalculationGroup$asString(seperator = ", ")
seperator
A character value used when concatenating the text representations of different calculations.
A character summary of various object properties.
clone()
The objects of this class are cloneable with this method.
PivotCalculationGroup$clone(deep = FALSE)
deep
Whether to make a deep clone.
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.