[Rd] Saving Rcpp Objects for Future Use

From: Michael King <wmichaelking1_at_gmail.com>
Date: Fri, 09 Sep 2011 16:07:25 -0400


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.

Thanks for your help.

-Mike

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 09 Sep 2011 - 20:48:00 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 10 Sep 2011 - 02:10:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive