I have a .xlsx
file has two sheets and I want to generate a list of both excel sheets using read_excel
from readxl
package . I have used this code
my_work <- lapply(excel_sheets("data.xlsx"),
read_excel,
path = "data.xlsx")
The read_excel()
function is called multiple times on the "data.xlsx"
file and each sheet is loaded in one after the other. The result is a list of data frames, each data frame representing one of the sheets in data.xlsx
.
My question is , why should I write the path argument in lapply
function , since the file is already in the working directory ?