Skip to content
Prev 44498 / 63424 Next

paths and Rook problems only in OSX CRAN binary package?

Richard,

I was away hence a late response.

The problem is that you are creating aovApp directly at compile time, so it will hard-code the root path as the initialized object is lazy-loaded. This means that the package will only work in the library that it was complied into, it won't work anywhere else and thus it cannot be distributed as a binary package.

There are many possible fixes, probably the easiest is to simply make aovApp a function so the actual objects won't be lazy-loaded:

diff -ru BayesFactor/R/aovRook.R BayesFactor-fix/R/aovRook.R
--- BayesFactor/R/aovRook.R	2012-11-23 16:54:06.000000000 -0500
+++ BayesFactor-fix/R/aovRook.R	2012-11-26 09:32:48.000000000 -0500
@@ -119,7 +119,7 @@
     rookEnv$aov$s <- Rhttpd$new()
     rookEnv$aov$s$start(quiet=TRUE)
     rookEnv$aov$s$add(name="aov",
-          app=aovApp)
+          app=aovApp())
   }
   rookEnv$aov$s$browse("aov")
 }
@@ -262,7 +262,7 @@
   }
 }
 
-aovApp <- Builder$new(
+aovApp <- function() Builder$new(
   Static$new(
     urls = '/www',
     root = system.file('.', package='BayesFactor')


Cheers,
Simon
On Nov 21, 2012, at 3:57 PM, Richard D. Morey wrote: