| font {flextable} | R Documentation |
change font of selected rows and columns of a flextable.
font(x, i = NULL, j = NULL, fontname, part = "body")
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') |
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 <- regulartable(head(iris))
ft <- font(ft, fontname = fontname, part = "header")