The `PivotOpenXlsxStyles` class stores a collection of `PivotOpenXlsxStyle` style objects.
R6Class
object.
count
The number of `PivotOpenXlsxStyle` objects in this `PivotOpenXlsxStyles` collection.
styles
A list containing the `PivotOpenXlsxStyle` objects in this `PivotOpenXlsxStyles` collection.
new()
Create a new `PivotOpenXlsxStyles` object.
PivotOpenXlsxStyles$new(parentPivot)
parentPivot
The pivot table that this `PivotOpenXlsxStyles` instance belongs to.
A new `PivotOpenXlsxStyles` object.
clearStyles()
Clear the internal list of styles.
PivotOpenXlsxStyles$clearStyles()
No return value.
findNamedStyle()
Find an existing openxlsx style matching the name of a base style.
PivotOpenXlsxStyles$findNamedStyle(baseStyleName)
baseStyleName
The name of the base style to find.
A `PivotOpenXlsxStyle` object with the specified name.
findOrAddStyle()
Find an existing openxlsx style, add a new openxlsx style matching a base style and/or existing `PivotStyle` object.
PivotOpenXlsxStyles$findOrAddStyle( action = "findOrAdd", baseStyleName = NULL, isBaseStyle = NULL, style = NULL, mapFromCss = TRUE )
action
Must be one of "find" (to search for an existing style), "add" (to add a new style) or "findOrAdd" (default, to first search for an existing style, and if no match is found then add a new style)
baseStyleName
The name of the base style to find.
isBaseStyle
`TRUE` if the style being sought is a base style.
style
An existing `PivotStyle` object.
mapFromCss
Default `TRUE`, to create a new `PivotOpenXlsxStyle` by mapping from CSS style declarations.
This function is used in two different ways: (1) When adding base styles (i.e. named styles in the pivot table) to this `PivotOpenXlsxStyles` collection: In this case, `baseStyleName` is the name of the style and `isBaseStyle=TRUE` (so matching is by name only) and `style` is the `PivotStyle` object for the base style. (2) When finding styles that have been applied to individual cells using the `PivotStyle` object that is attached to each cell: In this case, `baseStyleName` may or may not be present, `isBaseStyle=FALSE` and `style` is the `PivotStyle` object from the cell.
A `PivotOpenXlsxStyle` object that has been found or added.
addNamedStyles()
Populate the OpenXlsx styles based on the styles defined in the pivot table.
PivotOpenXlsxStyles$addNamedStyles(mapFromCss = TRUE)
mapFromCss
Default `TRUE`, to create a new `PivotOpenXlsxStyle` by mapping from CSS style declarations.
No return value.
asList()
Return the contents of this object as a list for debugging.
PivotOpenXlsxStyles$asList()
A list of various object properties.
asJSON()
Return the contents of this object as JSON for debugging.
PivotOpenXlsxStyles$asJSON()
A JSON representation of various object properties.
asString()
Return a representation of this object as a character value.
PivotOpenXlsxStyles$asString(seperator = ", ")
seperator
A character value used when concatenating multiple styles.
A character summary of various object properties.
clone()
The objects of this class are cloneable with this method.
PivotOpenXlsxStyles$clone(deep = FALSE)
deep
Whether to make a deep clone.
# 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 DataCamp Workspace