I guess this is a bit of a beginner's question but I haven't quite found an answer or figured out what I'm doing wrong.
I'm trying to read 20 CSV files that are stored in a separate directory using:
setwd("./Data")
filenames <- list.files()
All <- lapply(filenames,function(i){
i <- paste(".\\",i,sep="")
read.csv(i, header=TRUE, skip=4)
})
And I get the following error:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file '.\filename.csv': No such file or directory
Where filename stand for the name of the first file in my folder.
Thanks in advance!