Learn R Programming

XLConnect (version 1.1.0)

removeSheet-methods: Removing worksheets from workbooks

Description

Removes a worksheet from a workbook.

Usage

# S4 method for workbook,character
removeSheet(object,sheet)
# S4 method for workbook,numeric
removeSheet(object,sheet)

Arguments

object

The workbook to use

sheet

The name or index of the sheet to remove

Author

Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch

See Also

workbook, createSheet, existsSheet, getSheets, renameSheet, cloneSheet, setActiveSheet

Examples

Run this code
if (FALSE) {
# mtcars xlsx file from demoFiles subfolder of package XLConnect
mtcarsFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")

# Load workbook
wb <- loadWorkbook(mtcarsFile)

# Remove the worksheet called 'mtcars' from the above file
removeSheet(wb, sheet = "mtcars")
}

Run the code above in your browser using DataLab