renameSheet-methods: Renaming worksheets from workbooks

Description Usage Arguments Note Author(s) See Also Examples

Description

Renames a worksheet from a workbook.

Usage

1
2
3
4
## S4 method for signature 'workbook,character'
renameSheet(object,sheet,newName)
## S4 method for signature 'workbook,numeric'
renameSheet(object,sheet,newName)

Arguments

object

The workbook to use

sheet

The name or index of the sheet to rename

newName

The new name of the sheet

Note

Note that renaming worksheets may result in invalid name references.

Author(s)

Martin Studer
Mirai Solutions GmbH http://www.mirai-solutions.com

See Also

workbook, createSheet, existsSheet, getSheets, removeSheet, cloneSheet, setActiveSheet

Examples

1
2
3
4
5
6
7
8
# 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")

Example output

Loading required package: XLConnectJars
OpenJDK 64-Bit Server VM warning: Can't detect initial thread stack location - find_vma failed
XLConnect 0.2-12 by Mirai Solutions GmbH [aut],
  Martin Studer [cre],
  The Apache Software Foundation [ctb, cph] (Apache POI, Apache Commons
    Codec),
  Stephen Colebourne [ctb, cph] (Joda-Time Java library),
  Graph Builder [ctb, cph] (Curvesapi Java library)
http://www.mirai-solutions.com ,
http://miraisolutions.wordpress.com
ZoneInfo: /usr/share/javazi/ZoneInfoMappings (Permission denied)
Warning message:
system call failed: Cannot allocate memory 

XLConnect documentation built on May 29, 2017, 7:04 p.m.