View source: R/read_excel_workbook.R
read_excel_workbook | R Documentation |
read_excel_workbook()
reads all the data from the sheets of an Excel workbook and return an appended dataframe.
read_excel_workbook(path, col_types = NULL, .id = NULL)
path |
Path to the xls/xlsx file. |
col_types |
Either |
.id |
The name of an optional identifier column. Provide a string to create an output column that identifies each input. The column will use names if available, otherwise it will use positions. |
A tibble. If there is any column type mismatch during data frames row binding, an error will occur. This is because R cannot combine columns of different types. For example, you cannot combine a column of integers with a column of characters.
read_excel()
, which reads a Sheet of an Excel file into a data frame, and read_gsheets()
, which imports data from multiple sheets in a Google Sheets.
path <- system.file("extdata", "Diamonds.xlsx", package = "bulkreadr", mustWork = TRUE)
read_excel_workbook(path = path, .id = "Year")
# Column types mismatch error --------------------------------------
# If the `read_excel_workbook()` function complains about a data type mismatch,
# then set the `col_types` argument to `"text"`.
# This will make all the column types in the resulting DataFrame be characters.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.