[Rd] Saving Rcpp Objects for Future Use
edd at debian.org
Sat Sep 10 00:52:00 CEST 2011
On 9 September 2011 at 16:07, Michael King wrote:
| I have recently been doing some research regarding how to successfully save
| and load Rcpp Objects ( objects from modules ) for future use, but with
| little success. For example, to use the example package (from package
| skeleton) in Rcpp:
| >Rcpp.package.skeleton("rdevelhelp", module=TRUE)
| > q()
| // install rdevelhelp using R CMD INSTALL
| // load new R Session
| >x <- new(World)
| >x$set("help me")
| "help me"
| >save(x, "x.RData")
| // reload R
| > ### here comes the problem...
| > x$greet()
| Error in .External(list(name = "CppMethod__invoke_notvoid", address =
| <pointer: 0x0>, :
| NULL value passed as symbol address
| is there a best practice to solving this problem? I have read some posts
| about external pointers and have learned a little about serialization, but
| want to make sure I am approaching the problem correctly.
This has been discussed several times _on the list dedicated to Rcpp
question_ ie rcpp-devel. You could try a search such as
site:gmane.org rcpp-devel 'reload module'
to catch some of those.
But in short: the load / save cycle is simply not available for Rcpp modules
| Thanks for your help.
Pleasure. Hope to see you over at rcpp-devel. Subscribe before you try to post.
| [[alternative HTML version deleted]]
| R-devel at r-project.org mailing list
Two new Rcpp master classes for R and C++ integration scheduled for
New York (Sep 24) and San Francisco (Oct 8), more details are at
More information about the R-devel