Having trouble trying to read in multiple .xlsx files to R from the same directory. I keep getting the following error.
"Error in path.expand(file) : argument "file" is missing, with no default"
My code is as follows.
require(.xlsx)
Files=list.files(path="I:/Marcs_Discretinization_try_1/Attempt1/Actual Data", pattern=".xlsx")
sapply(Files, read.xlsx2(sheetIndex=8))
The output of object Files looks like this which seemingly does not have the attached path.
[1] "2015-B1-2OR.xlsx" "2015-B1-OR10-B.xlsx" "2015-B1-OR10.xlsx" "2015-B1-OR19.xlsx" "2015-B2-OR19.xlsx"
[6] "2015-O1-2OR.xlsx" "2015-O1-OR10-B.xlsx" "2015-O1-OR10.xlsx" "2015-O2-2OR.xlsx" "2015-O2-OR10-B.xlsx"
[11] "2015-O2-OR10.xlsx" "2015-X1-2OR.xlsx" "2015-X1-OR10-B.xlsx" "2015-X1-OR10.xlsx" "2015-X2-2OR.xlsx"
[16] "2015-X2-OR10-B.xlsx" "2015-X2-OR10.xlsx"