Get file path of R script -


this question has answer here:

i file path of r script running. eg

when run function return

"c:/users/forename.surname/documents/foo.r"

(i running rstudio)

use getsrcdirectory() function. example, if put in file:

scriptpath <- function() {     getsrcdirectory(scriptpath); } 

then calling scriptpath() tell script file located.


Comments