set_specific_style-methods: Set styles of multiple cells

set_specific_styleR Documentation

Set styles of multiple cells

Description

This function can only be used inside another styling function, since the row_id and col_id calculation happens in the level-2 parent.frame.

Usage

set_specific_style(st, value, style_name, style_type, ...)

## S4 method for signature 'StyledTable,ANY,character,character'
set_specific_style(
  st,
  value,
  style_name,
  style_type,
  row_id = NULL,
  col_id = NULL,
  condition = NULL,
  condition_text = NULL,
  append_mode = "replace"
)

Arguments

st

A StyledTable object

value

The value that should be set

style_name

The name of the style slot that should be set

style_type

The type which the value has to have (used for type checking)

...

Various arguments

row_id

A vector of row ids to which the change should be applied to. The variable n_row can be used in the expression to name the total number of columns (will be replaced). If the argument row_id is omitted, then the change will be applied to all rows

col_id

A vector of column ids to which the change should be applied to. The variable n_col can be used in the expression to name the total number of columns (will be replaced). If the argument col_id is omitted, then the change will be applied to all columns

condition

An equation (non standard evaluation) that is evaluated on the data.frame data in order to decide on which rows or cells the change should be applied. In the equation the column names of the StyledTable object should be used. Be aware that the StyledTable object columns have the names X1, ..., XN, where N is the total number of columns. If you do not want to apply the change to all columns given in the col_id argument, but only to single cells which fullfill a special condition you can use also the variable name X which is substituted by each column name separately. The arguments condition_text and condition cannot be passed at the same time.

condition_text

An character string holding an equation that is evaluated on the data.frame data in order to decide on which rows or cells the change should be applied. In the equation the column names of the StyledTable object should be used. Be aware that the StyledTable object columns have the names X1, ..., XN, where N is the total number of columns. If you do not want to apply the change to all columns given in the col_id argument, but only to single cells which fullfill a special condition you can use also the variable name X which is substituted by each column name separately. The arguments condition_text and condition cannot be passed at the same time.

append_mode

A character string that defines if the styling value of the cell should be replaced (append_mode = "replace"), if the new styling should be appended at the end of the current styling value of the cell (append_mode = "appendBehind"), if the new styling should be appended in front of the current styling value of the cell (append_mode = "appendBefore")

Value

The modified StyledTable object

See Also

Other styledtable setters: set_bold(), set_border_color(), set_border_position(), set_excel_boldweight(), set_excel_border_pen(), set_excel_data_format(), set_excel_font_name(), set_excel_font_size(), set_excel_hidden(), set_excel_locked(), set_excel_pre_process(), set_excel_vertical(), set_excel_wrapped(), set_fill_color(), set_font_color(), set_horizontal(), set_html_pre_process(), set_indent(), set_italic(), set_latex_font_name(), set_latex_font_size(), set_latex_pre_process(), set_latex_vertical_move(), set_rotation(), set_strikeout(), set_underline()


R-package/styledTables documentation built on Feb. 6, 2024, 2:21 a.m.