Re: [Rcpp-devel] using an unloaded package's lazy-load data in Rcpp function

2018-04-16 Thread Kevin Ushey
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

Re: [Rcpp-devel] using an unloaded package's lazy-load data in Rcpp function

2018-04-16 Thread Jack Wasey
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.

Re: [Rcpp-devel] using an unloaded package's lazy-load data in Rcpp function

2018-04-15 Thread Kevin Ushey
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