Last active
August 29, 2015 14:08
-
-
Save air-drummer/044c945ce0b0af93eab0 to your computer and use it in GitHub Desktop.
Running chunks of R code in an arbitrary working directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Hadley: I use the following function to run chunks of R code in an arbitrary working directory. | |
run.in.dir <- function(dir, code) { | |
cur <- getwd() | |
setwd(dir) | |
on.exit(setwd(cur)) | |
force(code) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment