Well, feel free to ignore my post, but the gist was that anything you have
access to in R can be passed by your R API code to your Rcpp code. Also,
due to R's GC you should usually avoid caching references between calls to
your Rcpp code anyway.
On March 24, 2023 12:40:43 PM PDT, Matthew Supernaw - NOAA Federal <
matthew.supernaw at noaa.gov> wrote:
Hi Jeff,
I'm not sure I understand your comment. The code is part of a package.
We're just trying to sync the declared object name in the R environment to
the object in the Rcpp module programmatically from c++ for internal use.
just wondered if there was a way to access the wrapped object in the
Rcpp:::PreserveStorage class and Dirk answered that question.
Thanks.
Matthew
On Fri, Mar 24, 2023 at 2:34 PM Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote:
Matthew... the normal context for sharing Rcpp code is within a package.
It is a no-brainer to have an R API called by the user that calls
Rcpp code it needs to, which is why your objection seems inappropriate
me.
On March 24, 2023 10:43:34 AM PDT, Dirk Eddelbuettel <edd at debian.org>
wrote:
On 24 March 2023 at 13:08, Matthew Supernaw - NOAA Federal wrote:
| I'm sure it's possible to do from the R side, however, the
| hide this from the end user and set the reference objects name to the
| name from the R environment. If I view the environment in RStudio,
| much more information available. ls() only returns a list of objects
| declared name. I'm wondering how to get more details about elements
| environment.
Thanks for additional color. That may be a very interesting and
question _for the C API of R_ and youe guess of "maybe Rcpp has a
a good one. Sadly, I fear we may not have anything for you.
Dirk
--
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org