Learn R Programming

officer (version 0.7.6)

sheet_remove: Remove a sheet

Description

Remove a sheet from an xlsx workbook, deleting the worksheet XML, its relationship file and the content-type override.

Usage

sheet_remove(x, sheet)

Value

the rxlsx object (invisibly)

Arguments

x

rxlsx object

sheet

name of the sheet to remove

Examples

Run this code
wb <- read_xlsx()
wb <- add_sheet(wb, "kept")
default_name <- sheet_names(wb)[1]
wb <- sheet_remove(wb, sheet = default_name)
print(wb, target = tempfile(fileext = ".xlsx"))

Run the code above in your browser using DataLab