Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Sheet

Functions to manipulate worksheets.


Description

Functions to manipulate worksheets.

Usage

getSheets(wb)

createSheet(wb, sheetName = "Sheet1")

removeSheet(wb, sheetName = "Sheet1")

Arguments

wb

a workbook object as returned by createWorksheet or loadWorksheet.

sheetName

a character specifying the name of the worksheet to create, or remove.

Value

createSheet returns the created Sheet object.

getSheets returns a list of java object references each pointing to an worksheet. The list is named with the sheet names.

Author(s)

Adrian Dragulescu

See Also

To extract rows from a given sheet, see Row.

Examples

file <- system.file("tests", "test_import.xlsx", package = "xlsx")

wb <- loadWorkbook(file)
sheets <- getSheets(wb)

sheet  <- sheets[[2]]  # extract the second sheet

# see all the available java methods that you can call
rJava::.jmethods(sheet)

# for example
sheet$getLastRowNum()

xlsx

Read, Write, Format Excel 2007 and Excel 97/2000/XP/2003 Files

v0.6.5
GPL-3
Authors
Adrian Dragulescu [aut], Cole Arendt [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.