Description Usage Arguments Details Value Examples
Store all data in one list of lists (ie one list of workbooks, each workbook is a list of sheets, each sheet is a dataframe (or an error message if applicable))
1 | extract_excel(folder, general_case = NULL, weird_cases = NULL)
|
folder |
Path to folder |
general_case |
Args to be passed to |
weird_cases |
Args to be passed to |
general_case
is one flat list of args (lines to skip and the like) to be passed to readxl::read_excel
for all sheets.
weird_cases
is a nested list of such args for known specific cases.
It is recommended you try to read the data without these argument at first, and then make adjustments according to outputs.
The nested structure of weird_cases
is wb
(basename of Excel file) then sheet
(name of a sheet) then args. See Examples
.
You may specify neither or one or both. If you specify both, general_cases
is used and weird_cases
overwrites it only where applicable.
data A list of workbooks, each is a list of sheets as dataframes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# Where your Excel files are located
folder <- "./excel data/"
# First try without parameters
data_ <- extract_excel(folder)
# View all data
view_excel(data_)
# Second try with adjustments where things went wrong
weird_cases <- list(
"first workbook.xls" = list(
"sheet2" = list(skip = 3),
"sheet3" = list(skip = 2)
),
"wb2.xlsx" = list(
"tab2" = list(skip = 3, col_names = FALSE)
)
)
data_ <- extract_excel(folder, weird_cases)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.