aboutsummaryrefslogtreecommitdiff
path: root/SyncRNG.R
diff options
context:
space:
mode:
authorGertjan van den Burg <burg@ese.eur.nl>2015-07-31 14:34:54 +0200
committerGertjan van den Burg <burg@ese.eur.nl>2015-07-31 14:34:54 +0200
commit49680032d98a78964c76f04bf8d1fec501612147 (patch)
tree248a232a123af94611179331b958ccba2f7e7305 /SyncRNG.R
parentallow installation as python module (diff)
downloadSyncRNG-49680032d98a78964c76f04bf8d1fec501612147.tar.gz
SyncRNG-49680032d98a78964c76f04bf8d1fec501612147.zip
more reliable way to import SyncRNG from R
Diffstat (limited to 'SyncRNG.R')
-rw-r--r--SyncRNG.R5
1 files changed, 4 insertions, 1 deletions
diff --git a/SyncRNG.R b/SyncRNG.R
index 2fbb160..90e6fd5 100644
--- a/SyncRNG.R
+++ b/SyncRNG.R
@@ -1,6 +1,9 @@
library(methods)
-script.dir <- normalizePath(dirname(sys.frame(1)$ofile))
+frame.files <- lapply(sys.frames(), function(x) x$ofile)
+frame.files <- Filter(Negate(is.null), frame.files)
+
+script.dir <- normalizePath(dirname(frame.files[[length(frame.files)]]))
source.file <- paste(script.dir, '/', 'RSyncRNG.so', sep='')
dyn.load(source.file)