
Renaming worksheets from workbooks
renameSheet-methods.RdRenames a worksheet from a workbook.
Usage
# S4 method for class 'workbook,character'
renameSheet(object,sheet,newName)
# S4 method for class 'workbook,numeric'
renameSheet(object,sheet,newName)Arguments
- object
The
workbookto use- sheet
The name or index of the sheet to rename
- newName
The new name of the sheet
Author
Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch
Examples
if (FALSE) { # \dontrun{
# mtcars xlsx file from demoFiles subfolder of package XLConnect
mtcarsFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")
# Load workbook
wb <- loadWorkbook(mtcarsFile)
# Rename the worksheet called 'mtcars' from the above file to 'MyCars'
renameSheet(wb, sheet = "mtcars", newName = "MyCars")
} # }