что-то вроде этого?
код
files <- list.files(path = "./", pattern = "*.xlsx$", recursive = FALSE, full.names = TRUE)
sheet_to_read <- c( 8, 9, 10 )
library( readxl )
for( excelsheet in files) {
for (sheet in sheet_to_read) {
temp <- read_excel( path = excelsheet, sheet = sheet)
write.csv( temp, file = paste0( "./", gsub("./", "", excelsheet), "-sheet", sheet,".csv") )
}
}
результат