In R, I want to access to some file in subfolder. But I don\'t want to change working directory then move back. It lost time and long.
For exmaple, I working on /
I don't know if this is what you were looking for, but I have a library of files in a specific github folder that I source when I initialize a project in a new branch, and I found one solution online like this:
setwd("~/repos/library/all_the_things")
library_files <- list.files()
sapply(library_files, source)
which is great except now I'm starting every file in a directory where I wouldn't want to save plots etc., so I realized all it needed was this:
library_files <- list.files("~/repos/library/all_the_things", full.name=T)
sapply(library_files, source)
and now it runs them without changing directories.