appendNamedRegion-methods: Appending data to a named region

Description Usage Arguments Details Note Author(s) See Also Examples

Description

Appends data to an existing named region.

Usage

1
2
## S4 method for signature 'workbook,ANY'
appendNamedRegion(object,data,name,header,rownames)

Arguments

object

The workbook to use

data

Data to write

name

Name of the (existing) named region to which to append the data

header

Specifies if the column names should be written. The default is FALSE.

rownames

Name (character) of column to use for the row names of the provided data object. If specified, the row names of the data object (data.frame) will be included as an additional column with the specified name. If rownames = NULL (default), no row names will be included.

Details

Appends data to the existing named region specified by name. The data is appended at the bottom of the named region. See writeNamedRegion for further information on writing named regions.

Note

Named regions are automatically redefined to the area occupied by the previous and the newly appended data. This guarantees that the complete set of data can be re-read using readNamedRegion. Note however, that no checks are performed to see whether the appended data has the same shape/structure as the previous data.

Author(s)

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

See Also

workbook, writeNamedRegion, readNamedRegion, writeWorksheet, appendWorksheet, readWorksheet

Examples

1
2
3
4
5
6
7
8
# mtcars xlsx file from demoFiles subfolder of package XLConnect
demoExcelFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")

# Load workbook
wb <- loadWorkbook(demoExcelFile)

# Append mtcars data set to named region named 'mtcars'
appendNamedRegion(wb, mtcars, name = "mtcars")

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 April 6, 2018, 1:03 a.m.