Use dplyr::group_split
to split a workbook into a list of workbooks
Source: R/wb_split.R
wb_split.Rd
wb_split()
uses wb_to_df_list()
to extract the data frames from each
sheet of a workbook and then split the data frames by a .key
argument then
convert each new list of data frames back into a wbWorkbook object.
Usage
wb_split(
file,
.by,
...,
.keep = TRUE,
properties = "inherit",
wb_params = list()
)
Arguments
- file
An xlsx file, wbWorkbook object or URL to xlsx file.
- .by
Passed to
dplyr::group_split()
.- ...
Arguments passed on to
wb_to_df_list
sheet_names
Character vector of sheet names. If not supplied, all sheet names from the supplied workbook are used.
- .keep
Should the grouping columns be kept?
- properties
If "inherit" (default) and
file
is a workbook, inherit the workbook list element properties from the existing workbook. properties can also beNULL
or a named character vector, a named list, or a bare list of the same length as the number of groups defined using the.by
argument.- wb_params
List of additional parameters to pass to
map_wb()
andas_wb()
.