Last active
January 16, 2021 13:43
-
-
Save tanerumit/dd7eca6f9aacf778730be0580592ebf6 to your computer and use it in GitHub Desktop.
#R #function to source all scripts in a 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
### Sourcing | |
sourceDir <- function(path, trace = TRUE, ...) { | |
for (nm in list.files(path, pattern = "\\.[RrSsQq]$")) { | |
if(trace) cat(nm,":") | |
source(file.path(path, nm), ...) | |
if(trace) cat("\n") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment