set_style: Change the appearance of cells in a table

Description Usage Arguments Details Value Examples

View source: R/set_style.R

Description

Allows you to set the visual appearance of single cells or ranges in a table

Usage

1
set_style(table, rows = 1:table$nrow, cols = 1:table$ncol, ...)

Arguments

table

The SimplePlotTable to change

rows

The indexes of rows which should be styled, defaults to all rows

cols

The indexes of columns which should be styled, defaults to all columns

...

The properties to change. Argument names must be aesthetics accepted by ggplot2::geom_text().

Details

This function allows for styling of cells in a SimplePlotTable. The cells to be changed are identified by rows and cols. Every cell that is in any of the rows and any of the columns specified is changed.

Value

A SimplePlotTable with changed styling.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
table <- new_SimplePlotTable(mtcars)

# Make all cells blue
table <- set_style(table, col="blue")

# Make the second column italic
table <- set_style(table, cols=2, fontface="italic")

# Make rows 2 through 4 diagonal and typeset in Times New Roman
table <- set_style(table, rows=2:4, family="Times New Roman", angle=45)

# Make the range of cells spanning from (2,2) to (5,8) bold
table <- set_style(table, rows=2:8, cols=2:5, fontface="bold")

Schmitzi/simplePlotTable documentation built on March 21, 2021, 4:35 a.m.