Sorry, you're correct -- lazy-loaded data gets extracted not from the
package namespace but from the 'lazydata' portion of the namespace info.
Ultimately, I think you'll just want to call back to R to get what you
want, e.g.
getExportedValue("nycflights13", "flights")
On Mon, Apr 16, 2018 at
Thanks for the reply. The solution of requiring the namespace from within Rcpp
hadn't occurred to me.
I had used Environment::namespace_env("pkg_name") before, but I think the
problem here is that lazy-loaded (and maybe other elements we expect in R) are
not available if this is done from Rcpp.
The environments called 'package:foo' are associated with attached
packages; that is, they're located on the search path. You likely want to
find the actual package namespace.
I think we have a static function Environment::namespace_env() for this. Or
you can just call back to R with requireNamesp
Dear all,
It seems I can reference lazy-loaded data from an unloaded, unattached package
from R, but not using the equivalent Rcpp as described in the quickref
document. I checked out:
http://dirk.eddelbuettel.com/code/rcpp/html/Environment_8h_source.html and even
the scant references to envir