theme_flextable: Format a flextable object for a Word or PowerPoint document

Description Usage Arguments Value Examples

Description

This function applies formatting to flextable objects, using the State of Minnesota template for tables, which can be rendered in R Markdown to Word or PowerPoint. This function applies the theme only to existing elements when the function is called, and it should be applied only after all elements of the table have been added.

Usage

1
2
3
4
5
6
7
theme_ft_mn(
  ft_tbl,
  last_row_bold = FALSE,
  color = "gray",
  fontsize = 11,
  borders = "narrow"
)

Arguments

ft_tbl

flextable object created using the flextable package

last_row_bold

logical value to indicate whether the last row should be bold. Defaults to FALSE.

color

string value to apply color scheme. Defaults to "gray". Other options include "blue" and "green". Word documents should use "gray".

fontsize

numeric value to set the size of all fonts in the table. Defaults to 11. Word documents should use size 11.

borders

string value to indicate whether borders are "narrow" or "thick". Defaults to "narrow". Word documents should use "narrow".

Value

A 'flextable' object

Examples

1
2
3
4
5
if (require("flextable")) {
  ft <- flextable(head(mtcars))
  ft <- theme_ft_mn(ft)
  ft 
}

jfangmeier/mnbrand documentation built on Jan. 25, 2022, 6:35 p.m.