I would read every sheet in the list:
Get file names:
f = list.files("./")
Reading files:
dat = lapply(f, function(i){
x = read.xlsx(i, sheetIndex=1, sheetName=NULL, startRow=5,
endRow=NULL, as.data.frame=TRUE, header=T)
x = x[, c(1, 3, 5)]
x$file = i
x
})
Then you can access the items in your list:
dat[[1]]
Or do the same task with them:
lapply(dat, colmeans)
( ):
dat = do.call("rbind.data.frame", dat)