readxl - Import tabbed spreadsheet into list in R -


my data exists tabbed spreadsheet, , i'm trying write script import it.

library(readxl) oput <- 0  tabnames <- excel_sheets("dataset.xlsx")  for(x in seq_along(tabnames)){     assign(tabnames[x], read_excel("dataset.xlsx", sheet = tabnames[x], col_names = true) } 

this works, giving me multiple datasheets in environment:

  • tab1
  • tab2 ...

what have these outputs items in list:

>oput $tab1 [1] data1 $tab2 [1] data2 ... 

but can't working properly

assign(oput[[x]],  read_excel("dataset.xlsx", sheet = tabnames[x], col_names = true) 

and

assign(oput$x,  read_excel("dataset.xlsx", sheet = tabnames[x], col_names = true) 

both give:

error in assign(oput[[x]], read_excel("dataset.xlsx",  :  invalid first argument 

it's error on part in identifying sheetname variable.

what's correct way of doing this, please?

found on different search terms. apologies duplicate post.

how read worksheets in excel workbook r list data.frame elements using xlconnect?