Description Usage Arguments Value See Also Examples
View source: R/read_excel_all_sheets.R
This function pulls in all sheets in an excel document. It passes the same arguments for every sheet. Thefore it is best used on excel files where the sheets have identical layouts but have split the data into separate sheets by some grouping characteristic (e.g. state, year, company). An additional column (name controlled by 'sheet_id' paramater) tracks the name of each sheet in the returned tibble.
It takes all the parameters of read_excel EXCEPT 'sheet', the list of sheets is obtained through a call to 'readxl::excel_sheets()'. Future versions of this function should include a 'sheets' parameter to allow the user to specify explicitly which sheets to read.
Stackoverflow for help building the function:
https://stackoverflow.com/q/58243710/3373438
1 | read_excel_all(path, ..., sheet_id = ".sheet")
|
path |
Path to the xls/xlsx file |
... |
all arguments to readxl::read_excel() EXCEPT sheet. If you try to explicitly use a sheet param the function will break. |
sheet_id |
default = ".sheet": name of column that contains the sheet_name |
a tibble
1 | read_excel_all(readxl::readxl_example("datasets.xlsx"), n_max = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.