-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
execute embedded R script in specified env #852
Conversation
For unit tests, please have a look at |
@eddelbuettel Thanks for the pointers, I'll see how far I get with those and will report here! |
@eddelbuettel Added a test, that fails if the |
In that case could you actually have it fail and catch the failure? We have plenty of other tests catching exceptions and errors; RUnit supports that. |
@eddelbuettel in this particular case, I think it is hard to do: It would involve me overriding the |
Maybe. Methinks you could mod your example from #851 to provide the "wrong" Took a number of years for someone to come along and declare this a problem :) |
I'm not sure if I understand. This fix makes sure that embedded R code is executed in the R environment in which the RCpp-generated functions are made available, instead of the default |
My thought was that you don't have to have the R code of your C++ snippet executed via the |
It's actually the other way around. The point of #851 is to source the R code in my new environment. Making available the Rcpp functions works fine already. |
I went all-in and did a reverse depends check, with was (as expected) without issues, so folding this in. |
Fixes #851
As mentioned in the issue, I have no idea about how to include a unit test to verify the new behavior; I am open to suggestions or somebody else adding it. Thanks!
I checked locally and it works:
test.rcpp
in R: