Re: [R] repeating functions for different folders?

2018-04-12 Thread Rui Barradas
Hello, Inline. On 4/13/2018 1:10 AM, Jim Lemon wrote: Hi Marna, Assuming that you are descending into different subdirectories from the same directory: Maybe this assumption is not needed. Since setwd returns the current directory, it is safer to assign that value to a variable and in the

Re: [R] repeating functions for different folders?

2018-04-12 Thread Jim Lemon
Hi Marna, Assuming that you are descending into different subdirectories from the same directory: directories<-c("dir1","dir2","dir3") for(directory in directories) { setwd(directory) # do whatever you want to do # then return to the directory above setwd("..") } This will allow you to start