How to Get Path to or Directory of Current Script in R
By Güngör Budak
- One minute read - 27 wordsUse following code to get the path to or directory of current (running) script in R:
1scr_dir <- dirname(sys.frame(1)$ofile)
2scr_path <- paste(scr_dir, "script.R", sep="/")