Hola,
On 9 September 2011 at 16:07, Michael King wrote:
| Hello,
|
| 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:
|
| >library(Rcpp)
| >Rcpp.package.skeleton("rdevelhelp", module=TRUE)
| ...
| > q()
| // install rdevelhelp using R CMD INSTALL
| // load new R Session
|
| >library(rdevelhelp)
| >x <- new(World)
| >x$set("help me")
| >x$greet()
| "help me"
| >save(x, "x.RData")
| >q()
|
| // reload R
| >library(rdevelhelp)
| >load("x.RData")
| > ### here comes the problem...
| > x$greet()
| Error in .External(list(name = "CppMethod__invoke_notvoid", address
| <pointer: 0x0>, :
| NULL value passed as symbol address
| >q()
|
| ################
|
| 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
objects.
| Thanks for your help.
Pleasure. Hope to see you over at rcpp-devel. Subscribe before you try to post.
Dirk
| -Mike
|
| [[alternative HTML version deleted]]
|
| ______________________________________________
| R-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel
--
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
http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10
http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php