FlexTableStyles {basictabler}R Documentation

R6 class that defines a collection of styles as used by the 'flextable' package.

Description

The 'FlexTableStyles' class stores a collection of 'FlexTableStyle' style objects.

Format

R6Class object.

Active bindings

count

The number of styles in the collection.

styles

A list of 'FlexTableStyle' objects that comprise the collection.

Methods

Public methods


Method new()

Create a new 'FlexTableStyles' object.

Usage
FlexTableStyles$new(parentTable)
Arguments
parentTable

Owning table.

Returns

No return value.


Method clearStyles()

Clear the collection removing all styles.

Usage
FlexTableStyles$clearStyles()
Returns

No return value.


Method findNamedStyle()

Find a style in the collection matching the specified base style name.

Usage
FlexTableStyles$findNamedStyle(baseStyleName)
Arguments
baseStyleName

The style name to find.

Returns

A 'TableTableFlexTbl' object that is the style matching the specified base style name or 'NULL' otherwise.


Method findOrAddStyle()

Find a style in the collection matching the specified base style name and style properties. If there is no matching style, then optionally add a new style.

Usage
FlexTableStyles$findOrAddStyle(
  action = "findOrAdd",
  baseStyleName = NULL,
  isBaseStyle = NULL,
  style = NULL,
  mapFromCss = TRUE
)
Arguments
action

The action to carry out. Must be one of "find", "add" or "findOrAdd" (default).

baseStyleName

The style name to find/add.

isBaseStyle

Is the style to be found/added a base style?

style

A 'TableStyle' object specifying style properties to be found/added.

mapFromCss

'TRUE' (default) to map the basictabler CSS styles to corresponding flextable styles, 'FALSE' to apply only the specified ft styles.

Returns

A 'TableTableFlexTbl' object that is the style matching the specified base style name or 'NULL' otherwise.


Method addNamedStyles()

Populate the FlexTbl styles based on the styles defined in the table.

Usage
FlexTableStyles$addNamedStyles(mapFromCss = TRUE)
Arguments
mapFromCss

'TRUE' (default) to map the basictabler CSS styles to corresponding Excel styles, 'FALSE' to apply only the specified ft styles.

Returns

No return value.


Method asList()

Return the contents of this object as a list for debugging.

Usage
FlexTableStyles$asList()
Returns

A list of various object properties.


Method asJSON()

Return the contents of this object as JSON for debugging.

Usage
FlexTableStyles$asJSON()
Returns

A JSON representation of various object properties.


Method asString()

Return the contents of this object as a string for debugging.

Usage
FlexTableStyles$asString(seperator = ", ")
Arguments
seperator

Delimiter used to combine multiple values into a string.

Returns

A character representation of various object properties.


Method clone()

The objects of this class are cloneable with this method.

Usage
FlexTableStyles$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# This class should not be used by end users.  It is an internal class
# created only by the BasicTable class.  It is used when converting to a
# flextable.

[Package basictabler version 1.0.2 Index]