I have multiple .xlsx files that I would like to read and combine into one file. However, each of the files contain two sheets so I would like to have one file that is all sheet 1 and then 1 file is all sheet 2.
I have used code like this before to read multiple files but it doesn't take into account different sheets.
files = list.files(path = "../input_data/",
pattern = "*.xlsx",
full.names = T)
combined_data = sapply(files, read_excel, simplify = F) %>%
rbind.fill()
I had tried adding the sheet parameter to the read_excel function but that didn't work. Any ideas? Thanks!