flextable (version 0.5.1)

font: Set font

Description

change font of selected rows and columns of a flextable.

Usage

font(x, i = NULL, j = NULL, fontname, part = "body")

Arguments

x

a flextable object

i

rows selection

j

columns selection

fontname

string value, the font name.

part

partname of the table (one of 'all', 'body', 'header', 'footer')

Examples

Run this code
# NOT RUN {
require("gdtools")
fontname <- "Times"

if( !font_family_exists(fontname) ){
  # if Times is not available, we will use the first available
  font_list <- sys_fonts()
  fontname <- as.character(font_list$family[1])
}

ft <- flextable(head(iris))
ft <- font(ft, fontname = fontname, part = "header")
# }

Run the code above in your browser using DataLab