create_data_styles | R Documentation |
This function sets some defaults for data_styles. See ?tbl_styles
create_data_styles(
double = list(test = is.double, style = openxlsx::createStyle(numFmt = "0.00")),
integer = list(test = is.integer, style = openxlsx::createStyle(numFmt = "0")),
...
)
double |
style for columns of type double |
integer |
style for columns of type integer |
... |
add further styles |
Styles are applied to the columns in the data set based on their classes (e.g., numeric, character, etc.). data_styles must be a list of lists. Each inner list must have two elements: a "test" that is used to determine the class of a data colum (e.g., is.double) and a style that is then applied to the columns where the test returns TRUE. Note that styles will be applied in the order of the list, meaning that a later style may overwrite an earlier style.
a list of lists with styles
library(tablespan)
# Make all booleans bold:
create_data_styles(boolean = list(test = is.logical,
style = openxlsx::createStyle(textDecoration = "bold")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.