
Last chance! 50% off unlimited learning
Sale ends in
workbook
.## S3 method for class 'workbook,ANY,character':
writeWorksheet(object,data,sheet,startRow,startCol,header,rownames)
## S3 method for class 'workbook,ANY,numeric':
writeWorksheet(object,data,sheet,startRow,startCol,header,rownames)
workbook
to write tostartRow = 1
.startCol = 1
.TRUE
.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 data
to the worksheet specified by
sheet
. data
is assumed to be a data.frame
and is
coerced to one if this is not already the case. startRow
and
startCol
define the top left corner of the data region to be
written. Note that the arguments are vectorized and as such multiple
data objects (data.frame
's) can be written to different
worksheets in one call. In this case data
is assumed to be a list
of data.frame
s.workbook
,
writeNamedRegion
,
appendWorksheet
,
appendNamedRegion
,
readWorksheet
,
readNamedRegion
,
writeWorksheetToFile
# Load workbook (create if not existing)
wb <- loadWorkbook("writeWorksheet.xlsx", create = TRUE)
# Create a worksheet called 'CO2'
createSheet(wb, name = "CO2")
# Write built-in data set 'CO2' to the worksheet created above;
# offset from the top left corner and with default header = TRUE
writeWorksheet(wb, CO2, sheet = "CO2", startRow = 4, startCol = 2)
# Save workbook (this actually writes the file to disk)
saveWorkbook(wb)
Run the code above in your browser using DataLab