Skip to content

Instantly share code, notes, and snippets.

@Jianghao
Created July 1, 2016 04:07
Show Gist options
  • Save Jianghao/a4b803d18775ce103a5f343d400b71f4 to your computer and use it in GitHub Desktop.
Save Jianghao/a4b803d18775ce103a5f343d400b71f4 to your computer and use it in GitHub Desktop.
# If you want to source() a bunch of files, something like
# the following may be useful:
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")
}
}
sourceDir("C:/Users/wangjh/Desktop/MODIS/R")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment