@hadleywickham I'll check out chdir=T, and I definitely agree that hard-coding setwd() in scripts makes no sense.