import_excel {lehuynh}R Documentation

Import Excel file with multiple sheets

Description

This function imports an Excel file with multiple sheets and returns a named list of imported sheets.

Usage

import_excel(file_path)

Arguments

file_path

A character string specifying the path to the Excel file.

Value

A named list where each element is the imported sheet from the Excel file, with names corresponding to the sheet names.

Examples

## For demo, a temp. file path is created with the file extension .xlsx
excel_file <- tempfile(fileext = ".xlsx")

## create Excel file with multiple sheets to import
writexl::write_xlsx(list(cars = head(cars), mtcars = head(mtcars)),
                    excel_file)

import_excel(file_path = excel_file)

[Package lehuynh version 0.1.1 Index]