Learn R Programming

openxlsx2 (version 0.5.1)

wb_add_page_break: Add a page break to a worksheet

Description

Insert page breaks into a worksheet

Usage

wb_add_page_break(wb, sheet = current_sheet(), row = NULL, col = NULL)

Arguments

wb

A workbook object

sheet

A name or index of a worksheet

row, col

Either a row number of column number. One must be NULL

See Also

wb_add_worksheet()

Examples

Run this code
wb <- wb_workbook()
wb$add_worksheet("Sheet 1")
wb$add_data(sheet = 1, x = iris)

wb$add_page_break(sheet = 1, row = 10)
wb$add_page_break(sheet = 1, row = 20)
wb$add_page_break(sheet = 1, col = 2)

## In Excel: View tab -> Page Break Preview

Run the code above in your browser using DataLab