Permalink
Browse files

Tweaks to load.r

  • Loading branch information...
hadley committed Apr 11, 2009
1 parent 944d682 commit b30ef29b84601f86a4100d67de578fd5e72e297b
Showing with 3 additions and 8 deletions.
  1. +3 −8 load.r
View
11 load.r
@@ -1,11 +1,6 @@
library(plyr, warn.conflicts = FALSE)
-FILE <- (function() {
- attr(body(sys.function()), "srcfile")
-})()$filename
-PATH <- dirname(FILE)
+frame_files <- compact(llply(sys.frames(), function(x) x$ofile))
+PATH <- dirname(frame_files[[length(frame_files)]])
-source.with.err <- function(path) {
- tryCatch(source(path), error = function(x) {print(path); print(x)})
-}
-lapply(dir(file.path(PATH, "R"), full.name=T), source.with.err)
+lapply(dir(file.path(PATH, "R"), full.name=T), source)

0 comments on commit b30ef29

Please sign in to comment.