Re: [R] Problem with loop in folders

2020-04-25 Thread Fredrik Karlsson
Hi, I am sorry if I am misunderstanding what you are trying to do here, but can you simplify it this way? (unfortualtely, this is untested since I dont have a suitable set of files and a directory structure to test against) dbifiles <- list.files(pattern="*.dbi",recursive=TRUE) csvfiles <- gsub

Re: [R] Problem with loop in folders

2020-04-24 Thread Sarah Goslee
I suspect much if not all of your trouble would be eliminated by using file.path() instead of paste0(). https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/file.path (Also check your file name - you probably want a . between name and csv, so using paste(name, "csv", sep = ".") woul

Re: [R] Problem with loop in folders

2020-04-24 Thread Bert Gunter
What package is "read.dbf" from? What error message/behavior did you see? Should it be: path<-setwd(paste0("inpath/",folder)) ## did you forget the "/" ? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathe