[Rcpp-devel] Making objects in the C++ "side" persistent

F.Tusell fernando.tusell at ehu.es
Thu Mar 20 18:39:51 CET 2014


I have been reading "Exposing C++ functions and classes with Rcpp
modules" and find the idea interesting. However, I read in Section 5
that objects created
using an external pointer are not persistent from session to session.

For my purposes, I think I could use S4 objects that make C++ copies of
themselves at creation time, accessible via an external pointer. All
methods would then make use of the C++ copies for speed, and at the end
of the session the S4 copies that live in the R side would be saved.

I am thinking of writing code which at the start of a session checks all
(S4) objects in the workspace and recreate the C++ copies. Is this the
way to go? Has someone with a similar problem devised an alternative
solution? If anyone can offer some hints (or better yet, point to some
package that I can use for inspiration) I would  be grateful.

Best,


F.Tusell <fernando.tusell at ehu.es>



More information about the Rcpp-devel mailing list