Learn R Programming

vectra (version 0.6.2)

tbl_xlsx: Create a lazy table reference from an Excel (.xlsx) file

Description

Reads a sheet from an Excel workbook into a vectra node for lazy query execution. The sheet is read into memory via openxlsx2::read_xlsx() and then converted to vectra's internal format. Requires the openxlsx2 package.

Usage

tbl_xlsx(path, sheet = 1L, batch_size = .DEFAULT_BATCH_SIZE)

Value

A vectra_node object representing a lazy scan of the sheet.

Arguments

path

Path to an .xlsx file.

sheet

Sheet to read: either a name (character) or 1-based index (integer). Default 1L (first sheet).

batch_size

Number of rows per batch (default 65536).

Examples

Run this code
# \donttest{
if (requireNamespace("openxlsx2", quietly = TRUE)) {
  f <- tempfile(fileext = ".xlsx")
  openxlsx2::write_xlsx(mtcars, f)
  node <- tbl_xlsx(f)
  node |> filter(cyl == 6) |> collect()
  unlink(f)
}
# }

Run the code above in your browser using DataLab