Learn R Programming

XLConnect (version 1.1.0)

appendNamedRegion-methods: Appending data to a named region

Description

Appends data to an existing named region.

Usage

# S4 method for workbook,ANY
appendNamedRegion(object,data,name,header,overwriteFormulaCells,rownames,worksheetScope)

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.

overwriteFormulaCells

Specifies if existing formula cells in the workbook should be overwritten. The default is TRUE.

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.

worksheetScope

Optional character vector with worksheet name(s) to target a name defined in the specified sheet(s) only. If not specified, the first matching named region is appended to. Use "" to specifically target a globally-scoped named region.

Author

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

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.

See Also

workbook, writeNamedRegion, readNamedRegion, writeWorksheet, appendWorksheet, readWorksheet

Examples

Run this code
if (FALSE) {
# 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")
}

Run the code above in your browser using DataLab