Hi all,

I am trying to answer my own question (although it probably does not end up in the thread because I am not a subscribed and thus have to send a new mail).


The way I finally got the code working was:


In NAMESPACE, comment out the following lines

# importFrom(Rcpp, loadModule)
# importFrom(Rcpp, evalCpp)



In zzz.R:

# loadModule("mod_yada",TRUE);

.pkgNamespace <- environment()

.onLoad <- function(libname, pkgname) {
  assign("mod_yada",
  Module("mod_yada",PACKAGE="testPackage",mustStart=TRUE),
  envir=.pkgNamespace);
}


The object generation then works as expected in the S4 class code.

Not sure whether this is the best way to achieve this, though.

Pascal

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to