setHeader: Set header for all worksheets

Description Usage Arguments Author(s) Examples

View source: R/wrappers.R

Description

DEPRECATED

Usage

1
setHeader(wb, text, position = "center")

Arguments

wb

A workbook object

text

header text. A character vector of length 1.

position

Position of text in header. One of "left", "center" or "right"

Author(s)

Alexander Walker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
wb <- createWorkbook("Edgar Anderson")
addWorksheet(wb, "S1")
writeDataTable(wb, "S1", x = iris[1:30, ], xy = c("C", 5))

## set all headers
setHeader(wb, "This is a header", position = "center")
setHeader(wb, "To the left", position = "left")
setHeader(wb, "On the right", position = "right")

## set all footers
setFooter(wb, "Center Footer Here", position = "center")
setFooter(wb, "Bottom left", position = "left")
setFooter(wb, Sys.Date(), position = "right")

saveWorkbook(wb, "headerHeaderExample.xlsx", overwrite = TRUE)

## End(Not run)

Example output

Warning message:
In setHeader(wb, "This is a header", position = "center") :
  This function is deprecated. Use function 'setHeaderFooter()'
Warning message:
In setHeader(wb, "To the left", position = "left") :
  This function is deprecated. Use function 'setHeaderFooter()'
Warning message:
In setHeader(wb, "On the right", position = "right") :
  This function is deprecated. Use function 'setHeaderFooter()'
Warning message:
In setFooter(wb, "Center Footer Here", position = "center") :
  This function is deprecated. Use function 'setHeaderFooter()'
Warning message:
In setFooter(wb, "Bottom left", position = "left") :
  This function is deprecated. Use function 'setHeaderFooter()'
Warning message:
In setFooter(wb, Sys.Date(), position = "right") :
  This function is deprecated. Use function 'setHeaderFooter()'
Note: zip::zip() is deprecated, please use zip::zipr() instead

openxlsx documentation built on June 16, 2021, 9:06 a.m.