Learn R Programming

lehuynh (version 0.1.1)

import_excel: 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)

Value

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

Arguments

file_path

A character string specifying the path to the Excel file.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab