GÜNGÖR BUDAK

Bioinformatics Analyst at Seven Bridges & PhD Student at METU

How to Get Path to or Directory of Current Script in R

Use following code to get the path to or directory of current (running) script in R:

scr_dir <- dirname(sys.frame(1)$ofile)
scr_path <- paste(scr_dir, "script.R", sep="/")

Taken from SO