I am trying to set the working directory to a different subfolder in a function. I expected the print command to print
C:/Users/Blah/Desktop/dir2/SUBFOLDER
instead it prints
C:/Users/Blah/Desktop/dir2
Yet when I run dirs in console I get:
C:/Users/Blah/Desktop/dir2/SUBFOLDER
...(Much longer list)
like I expected. Here is my code:
temp<-function(path)
{
print(path) #output is C:/Users/Blah/Desktop/dir2
setwd(path)
print(getwd())
xml=xmlParse("filename.xml")
...
}
dirs<-list.dirs("C:/Users/Blah/Desktop/dir2")
lapply(dirs,temp)#apply function tempt to every item in dirs