Reads an Excel file sheet and creates a pivot_table
object. The sheet is
expected to contain one or more pivot tables. Each line in the sheet
corresponds to a row in a table. The file and sheet names can be included as
part of the object attributes.
Arguments
- file
A string, name of an Excel file.
- sheetIndex
A number, sheet index in the workbook.
- sheetName
A string, sheet name.
- define_page
A integer, 0: no page, 1: file name as page, 2: sheet name as page, 3: file and sheet names as page, separated by the indicated separator.
- page_sep
A string, separator to form the page value.
Details
When multiple files or sheets are handled, the file and/or sheet names may
contain information associated with the pivot table, they could be the table
page information. In order not to lose this information, they can be stored
in the pivot_table
object.
See also
Other import functions:
read_excel_file()
,
read_excel_folder()
,
read_text_file()
,
read_text_folder()
Examples
file <- system.file("extdata", "excelfolder/m4.xlsx", package = "flattabler")
pt <- read_excel_sheet(file)
pt <- read_excel_sheet(file, sheetName = "Hoja2", define_page = 1)