getTables-methods.RdQueries the available Excel tables on the specified worksheet.
# S4 method for class 'workbook,numeric'
getTables(object,sheet,simplify)
# S4 method for class 'workbook,character'
getTables(object,sheet,simplify)The workbook to use
Index (integer) or name (character) of worksheet to query
logical specifying if the result should be simplified (defaults
to TRUE). See details.
Since this is a vectorized function (multiple sheets can be specified) the result is a
named list (one component per sheet) if no simplification is applied. In cases where only
one sheet is queried and simplify = TRUE (default) the result is simplified to a
vector.
if (FALSE) { # \dontrun{
# mtcars xlsx file from demoFiles subfolder of package XLConnect
demoExcelFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")
# Load workbook
wb <- loadWorkbook(demoExcelFile)
# Query available tables (table names) on sheet 'mtcars_table'
tables <- getTables(wb, sheet = "mtcars_table")
# ... or via sheet index
tables <- getTables(wb, sheet = 4)
} # }