Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upexecute 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.rcppin R: