Created
December 23, 2016 22:05
-
-
Save atajti/7c2a37ad37ef3fae900b98cd904e0f99 to your computer and use it in GitHub Desktop.
get the running R script's 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
get_script_dir <- function(){ | |
ca <- commandArgs() | |
script_path <- gsub("--file=", "", | |
ca[grepl("--file=", ca)]) | |
return(dirname(script_path)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment