You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
284 B
R

# To source a bunch of files in the same directory
sourceDir <- function(path, trace = TRUE) {
for (nm in list.files(path, pattern = "\\.[Rr]$")) {
if(trace) {
cat(nm,":")
}
source(file.path(path, nm))
if(trace) {
cat("\n")
}
}
}