Displaying 2 results from an estimated 2 matches for "simpleerrorexpr".
2020 Mar 24
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
...cpp_fast_eval(call, R_GlobalEnv);
Good catch.
And recursive grep for Rf_lang2 in the Rcpp sources tree suggests this is as the
common pattern in all other instances.
Dirk
edd at rob:~/git/rcpp(master)$ ag Rf_lang2 inst/include/
inst/include/Rcpp/exceptions.h
360: Rcpp::Shield<SEXP> simpleErrorExpr(Rf_lang2(::Rf_install("simpleError"), txt));
365: Rcpp::Shield<SEXP> simpleErrorExpr( Rf_lang2(::Rf_install("simpleError"), tryError ));
388: Rcpp::Shield<SEXP> expr( Rf_lang2( stop_sym , condition ) ) ;
395: Rcpp::Shield<SEXP> expr( Rf_lang2( stop...
2020 Mar 24
2
help with rchk warnings on Rf_eval(Rf_lang2(...))
> Shield<SEXP> res(Rcpp_fast_eval(Rf_lang2(asEnvironmentSym, x), R_GlobalEnv));
The call should be protected before evaluation though. So more like:
Shield<SEXP> call(Rf_lang2(asEnvironmentSym, x));
return Rcpp_fast_eval(call, R_GlobalEnv);
Best,
Lionel
On 3/23/20, Dirk Eddelbuettel <edd at debian.org> wrote:
>
>
> On 23 March 2020 at 17:07, Ben Bolker wrote:
>