Modify a previously created style with excel_output_style()
.
Details
modify_output_style()
is based on the Output Delivery System (ODS) in 'SAS',
which provides efficient and readable ways to set up different table styles.
With the output style you have full control over the table design. There is no need to think about calculating the right place to input a background color or a border of a certain type and how to do this in a loop for multiple cells. Just input colors, borders, font styles, etc. for the different table parts and everything else is handled by the functions capable of using styles.
The concept basically is: design over complex calculations.
See also
Creating a custom table style: excel_output_style()
,
number_format_style()
, modify_number_formats()
.
Functions that can handle styles: frequencies()
, crosstabs()
, any_table()
,
export_with_style()
Examples
# For default values
excel_style <- excel_output_style()
# Set specific options, the rest will be kept as is
excel_style <- excel_style |> modify_output_style(sheet_name = "Sheet",
title_font_bold = FALSE)
# For cells with no background color pass an empty string
excel_style <- excel_style |> modify_output_style(table_back_color = "")