makeRegionFunction: Create function for writing to worksheet

Description Usage Arguments Details Author(s)

View source: R/ref_helpers.R

Description

Create a function for writing named regions to a predefined worksheet.

Usage

1
2
makeRegionFunction(wb, sheetname, defaultRow = TRUE, defaultCol = TRUE,
  defaultHeader = TRUE)

Arguments

wb

An excel workbook object

sheetname

The name of a worksheet in the workbook object wb

defaultRow

Default logical value to use for absRow arg of returned function which indicates whether rows of cellrefs should be absolute references or not.

defaultCol

Default logical value to use for absCol arg of returned function which indicates whether columns of cellrefs should be absolute references or not.

defaultHeader

Default logical value of header arg of returned function which indicates whether column names of data should be written to the excel file.

Details

This function returns another convenience function for writing named regions to a given worksheet. The returned function takes a region name, cell references and a dataframe as its main arguments and writes the dataframe to the workbook & worksheet pair that were given as arguments to the parent function. If the worksheet does not yet exist it is created by the parent function. Similarly if the named region does not yet exist it is created by the child function. The child function also has named arguments 'header' (see 'writeNamedRegion') and 'absRow' & 'absCol' (see 'idx2cref'). The default values for these arguments can be set using 'defaultHeader', 'defaultRow', and 'defaultCol' arguments of the parent function.

Author(s)

Ben Veal


vapniks/XLConnectXtra documentation built on May 3, 2019, 4:33 p.m.