Skip to contents

wb_dims_ext() extends openxlsx2::wb_dims() by allowing a workbook input used to set x and supporting tidy selection for the cols argument.

Usage

wb_dims_ext(
  wb = NULL,
  sheet = openxlsx2::current_sheet(),
  cols,
  x = NULL,
  select = NULL,
  start_row = NULL,
  start_col = NULL,
  error_call = rlang::caller_env()
)

Arguments

select

A string, one of the followings. it improves the selection of various parts of x One of "x", "data", "col_names", or "row_names". "data" will only select the data part, excluding row names and column names (default if cols or rows are specified) "x" Includes the data, column and row names if they are present. (default if none of rows and cols are provided) "col_names" will only return column names "row_names" Will only return row names.

Value

A dims character string, or (if select = "cols") an integer vector of the selected column positions.

Examples

wb <- as_wb(mtcars[1:3, ])

wb_dims_ext(wb, sheet = "Sheet 1", cols = c(mpg, hp))
#> [1] "A2:A4,D2:D4"