Hi,
I need to import an Excel dataset with 4 sheets into R. I started with these codes but I'm stuck in the next step, importing the dataset into R.
This is what I used so far:
sheet_names <- excel_sheets("Alldata\Alldata_v20230616.xlsx") #get sheet names
sheet_names #print sheet names
Alldata_sheets <- lapply(sheet_names, function(x)
- {as.data.frame(read_excel("Alldata\Alldata_v20230616.xlsx", sheet = x))}) #Read all sheets to list
names(Alldata_sheets) <- sheet_names #rename list elements
head(Alldata_sheets$sheet1) # print head of sheet1
head(Alldata_sheets$sheet2) # print head of sheet2
head(Alldata_sheets$sheet3) # print head of sheet3
head(Alldata_sheets$sheet4) # print head of sheet4
My question is how to proceed and import data foe all sheets into R?
Thank you