Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

modifyBaseFont

Modify the default font


Description

Modify the default font for this workbook

Usage

modifyBaseFont(wb, fontSize = 11, fontColour = "black", fontName = "Calibri")

Arguments

wb

A workbook object

fontSize

font size

fontColour

font colour

fontName

Name of a font

Details

The font name is not validated in anyway. Excel replaces unknown font names with Arial. Base font is black, size 11, Calibri.

Author(s)

Alexander Walker

Examples

## create a workbook
wb <- createWorkbook()
addWorksheet(wb, "S1")
## modify base font to size 10 Arial Narrow in red
modifyBaseFont(wb, fontSize = 10, fontColour = "#FF0000", fontName = "Arial Narrow")

writeData(wb, "S1", iris)
writeDataTable(wb, "S1", x = iris, startCol = 10) ## font colour does not affect tables
## Not run: 
saveWorkbook(wb, "modifyBaseFontExample.xlsx", overwrite = TRUE)

## End(Not run)

openxlsx

Read, Write and Edit xlsx Files

v4.2.3
MIT + file LICENSE
Authors
Philipp Schauberger [aut, cre], Alexander Walker [aut], Luca Braglia [ctb], Joshua Sturm [ctb]
Initial release
2020-10-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.