Skip to contents

Reads a named Excel table from a workbook and returns an Arrow Table by default.

Usage

read_excel_table(
  file,
  table,
  columns = NULL,
  col_names = TRUE,
  header_row = NULL,
  skip_rows = NULL,
  n_max = Inf,
  schema_sample_rows = NULL,
  dtype_coercion = c("coerce", "strict"),
  dtypes = NULL,
  skip_whitespace_tail_rows = FALSE,
  whitespace_as_null = FALSE,
  as = c("arrow_table", "arrow_record_batch", "arrow_array", "tibble", "data.frame",
    "vector")
)

Arguments

file

Path to an Excel workbook, or a raw vector containing workbook bytes.

table

Name of the Excel table to read.

columns

Optional table columns to select, as a character vector of column names or a numeric vector of 1-based column positions.

col_names

TRUE to use the first row as names, FALSE to generate names, or a character vector of explicit names.

header_row

1-based row containing column names when col_names = TRUE. Use NULL to let the reader use its default first non-empty row behavior.

skip_rows

Number of rows to skip after the header row. Use NULL for the upstream default of skipping only empty leading rows.

n_max

Maximum number of data rows to read.

schema_sample_rows

Number of rows to sample for schema inference. Use NULL to sample all rows.

dtype_coercion

How to handle cells that do not match the inferred or specified type: "coerce" or "strict".

dtypes

Optional type override. Supply a single dtype string to apply to all selected columns, or a named character vector mapping column names to dtypes. Supported values are "null", "int", "float", "string", "boolean", "datetime", "date", and "duration".

skip_whitespace_tail_rows

Whether to ignore trailing rows containing only whitespace and null values.

whitespace_as_null

Whether string cells containing only whitespace are treated as missing values.

as

Type of object to return: "arrow_table", "arrow_record_batch", "arrow_array", "tibble", "data.frame", or "vector".

Value

The same output types as read_excel().