getLastRow-methods

0th

Percentile

Querying the last (non-empty) row on a worksheet

Queries the last (non-empty) row on a worksheet.

Keywords
methods, utilities
Usage
# S4 method for workbook,character
getLastRow(object,sheet)
# S4 method for workbook,numeric
getLastRow(object,sheet)
Arguments
object

The '>workbook to use

sheet

The name or index of the sheet of which to query the last row

Details

Returns the numeric index of the last non-empty row in the specified worksheet.

See Also

'>workbook

Aliases
  • getLastRow
  • getLastRow-methods
  • getLastRow,workbook,character-method
  • getLastRow,workbook,numeric-method
Examples
# NOT RUN {
# mtcars xlsx file from demoFiles subfolder of package XLConnect
demoExcelFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")

# Load workbook
wb <- loadWorkbook(demoExcelFile)

# Query the last row of the 'mtcars' worksheet
getLastRow(wb, "mtcars")

# Query the last row of the 'mtcars2' worksheet
getLastRow(wb, "mtcars2")

# Query the last row of the 'mtcars3' worksheet
getLastRow(wb, "mtcars3")
# }
Documentation reproduced from package XLConnect, version 0.2-14, License: GPL-3

Community examples

Looks like there are no examples yet.