read_excel_sheet: Import Excel file sheet

View source: R/read_excel.R

read_excel_sheetR Documentation

Import Excel file sheet

Description

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.

Usage

read_excel_sheet(
  file,
  sheetIndex = 1,
  sheetName = NULL,
  define_page = 3,
  page_sep = ":"
)

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.

Value

A pivot_table object.

See Also

pivot_table

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)


flattabler documentation built on Sept. 15, 2023, 1:06 a.m.