add_sheet: Add a sheet

View source: R/read_xlsx.R

add_sheetR Documentation

Add a sheet

Description

Add a sheet into an xlsx worksheet.

Usage

add_sheet(x, label)

Arguments

x

rxlsx object

label

sheet label

Details

read_xlsx() returns a workbook that already contains one default sheet shipped with the template (named "Sheet1" or "Feuil1" depending on the locale). add_sheet() is purely additive: the default sheet is kept as-is. Remove it explicitly with sheet_remove() if it is not wanted.

Examples

my_ws <- read_xlsx()
my_pres <- add_sheet(my_ws, label = "new sheet")

officer documentation built on April 24, 2026, 5:06 p.m.