renameSheet-methods | R Documentation |
Renames a worksheet from a workbook
.
## S4 method for signature 'workbook,character'
renameSheet(object,sheet,newName)
## S4 method for signature 'workbook,numeric'
renameSheet(object,sheet,newName)
object |
The |
sheet |
The name or index of the sheet to rename |
newName |
The new name of the sheet |
Note that renaming worksheets may result in invalid name references.
Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch
workbook
, createSheet
,
existsSheet
, getSheets
,
removeSheet
, cloneSheet
,
setActiveSheet
## Not run:
# 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.