With the following code, I am reading multiple csv files into dataframes.
setwd("/path/to/files")
filenames <- gsub("\\.csv$","", list.files(pattern="\\.csv$"))
for(i in filenames){
assign(i, read.csv(paste(i, ".csv", sep="")))
}
When I try to access them in the following code
for (i in filenames) {
imanDavenportTest(i)
}
I get the following error
Error in apply(data, MARGIN = 1, FUN = f) :
dim(X) must have a positive length
can someone help me?