How to extract sheet names from Excel file in R
In the "openxlsx" package it would be a command "getSheetNames":
library(openxlsx)
path <- "path/to/your/file.xlsx"
getSheetNames(path)
Another really nice package developed by the folks at RStudio is readxl
. It's easy to get the excel sheet names with the excel_sheets()
function.
library(readxl)
path <- "path/to/your/file.xlsx"
excel_sheets(path = path)
You are looking for getSheets
Returns all worksheet names in a workbook.