0

In the ReporteRs R package, one could set global options such as font family and size through R's options(). For instance, if I wanted to set my default fontsize to 10 and use Arial as a default font, I'd use

options('ReporteRs-fontsize' = 10, 'ReporteRs-default-font' = 'Arial Narrow')

Given that officer replaced ReporteRs, is there any similar command?

1 Answers1

2

I do this by defining the global variable as the top of my R file: e.g: fontSize = 10

font = 'Arial Narrow'

Then just calling this inside the function: Below is an example I use to change the colours of the theme I wrote.

header_colour <- rgb(143, 102, 51, max = 255)
border_colour <- rgb(184, 79, 64, max = 255)
inner_grey <- rgb(130, 130, 130, max = 255)
std_b <- fp_border(color="black", width = 2)

Then calling this inside my theme function:

theme <- function(x, odd_body = inner_grey, header = header_colour, headerFont = "white",
                      even_body = "transparent" ){}
Zuti
  • 85
  • 8