I wanted to read all the files and load multiple sheets from an excel file to R, use the xlsx package.
I pasted the code below:
filelist <- list.files(pattern = "\\.xls") # list all the xlsx files
library(xlsx)
allxlsx.files <- list() # create a list to populate with xlsx data
for (file in filelist) {
wb <- loadWorkbook(file)
sheets <- getSheets(wb)
sheet <- sheets[['_']] # get sheets with field section reading
res <- readColumns(sheet, 1, 2, 114, 120, colClasses=c("character", "numeric"))
}
traceback() 1: readColumns(sheet, 1, 2, 114, 120, colClasses = c("character", "numeric")) at #6
Can someone enlighten me how to proceed?
editoption to include output oftraceback()- Silence Dogood