Inspect Excel table column metadata in a workbook
Usage
excel_table_columns(
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,
available = FALSE
)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
TRUEto use the first row as names,FALSEto generate names, or a character vector of explicit names.- header_row
1-based row containing column names when
col_names = TRUE. UseNULLto let the reader use its default first non-empty row behavior.- skip_rows
Number of rows to skip after the header row. Use
NULLfor 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
NULLto 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.
- available
If
FALSE, return metadata for the selected columns. IfTRUE, return metadata for all available columns after applying header and dtype options, ignoringcolumns.
