Displaying 11 results from an estimated 11 matches for "rf_lang2".
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:
>
>
>...
2020 Mar 24
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
On 24 March 2020 at 11:39, Lionel Henry wrote:
| > 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);
Good catch.
And recursive grep for Rf_lang2 in the Rcpp sources tree suggests thi...
2020 Mar 23
5
help with rchk warnings on Rf_eval(Rf_lang2(...))
Thanks, that's really useful. One more question for you, or someone
else here:
const ArrayXd glmLink::linkFun(const ArrayXd& mu) const {
return as<ArrayXd>(::Rf_eval(::Rf_lang2(as<SEXP>(d_linkFun),
as<SEXP>(Rcpp::NumericVector(mu.data(),
mu.data() + mu.size()))
), d_rho);
}
I guess I need that to read
PROTECT(::Rf_eval(PROTECT(::Rf_lang2(...),...) , but as written it
doesn't seem I have anywhere to squeeze in an UNPROTECT(2). Do I need...
2020 Mar 23
2
help with rchk warnings on Rf_eval(Rf_lang2(...))
...familar to me, and that
are now being flagged as problematic by Tomas Kalibera's 'rchk'
machinery (https://github.com/kalibera/rchk); results are here
https://raw.githubusercontent.com/kalibera/cran-checks/master/rchk/results/lme4.out
The problem is with constructions like
::Rf_eval(::Rf_lang2(fun, arg), d_rho)
I *think* this means "construct a two-element pairlist from fun and arg,
then evaluate it within expression d_rho"
This leads to warnings like
"calling allocating function Rf_eval with argument allocated using Rf_lang2"
Is this a false positive or ... ? Can...
2020 Mar 23
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
...now being flagged as problematic by Tomas Kalibera's 'rchk'
> machinery (https://github.com/kalibera/rchk); results are here
> https://raw.githubusercontent.com/kalibera/cran-checks/master/rchk/results/lme4.out
>
> The problem is with constructions like
>
> ::Rf_eval(::Rf_lang2(fun, arg), d_rho)
>
> I *think* this means "construct a two-element pairlist from fun and arg,
> then evaluate it within expression d_rho"
>
> This leads to warnings like
>
> "calling allocating function Rf_eval with argument allocated using Rf_lang2"
>
&...
2014 Oct 22
1
Problems to compile examples of RInside
...ide/include/RInside.h:26,
from rinside_module_sample0.cpp:7:
rinside_module_sample0.cpp: In function ?int main(int, char**)?:
/usr/local/lib/R/site-library/Rcpp/include/Rcpp/Module.h:451:5: error: ?Shield? was not declared in this scope
Shield<SEXP> __load_module_call__( Rf_lang2( GET_MODULE_SYM, _rcpp_module_boot_##NAME() ); \
^
rinside_module_sample0.cpp:27:18: note: in expansion of macro ?LOAD_RCPP_MODULE?
R["bling"] = LOAD_RCPP_MODULE(bling) ;
^
/usr/local/lib/R/site-library/Rcpp/include/Rcpp/Module.h:451:5: note: suggested alternat...
2015 Dec 11
1
Runtime error when run a RInside program compiled by intel c++ on windows
...function. It gives following message after
Rf_initEmbeddedR():
Warning message:
In local(( :bytecode version mismatch: using eval
Error in objects(db.pos, all.name = TRUE) :
3 arguments passed to .Internal(ls) which requres 2
And it gives following error after Rf_eval(Rf_lang2(suppressMessagesSymbol,Rf_lang2(requireSymbol, Rf_mkString("Rcpp"))),R_GlobalEnv)
Error in .Internal(getOption(x)):
there is no .Internal function 'getOption'
Execution halted.
Does anyone know how to fix this error? Thanks....
2019 Jun 18
3
Fast way to call an R function from C++?
...functions (`R_forceAndCall` and `Rf_eval`)
that can do the "call" part, but both are slow compared to calling the same
function in R. I also try to use Rcpp and it is the worse one. Here is my
test code:
C++ code:
```
// [[Rcpp::export]]
SEXP C_test1(SEXP f, SEXP x) {
SEXP call =PROTECT(Rf_lang2(f, x));
SEXP val = R_forceAndCall(call, 1, R_GlobalEnv);
UNPROTECT(1);
return val;
}
// [[Rcpp::export]]
SEXP C_test2(SEXP expr, SEXP env) {
SEXP val = Rf_eval(expr, env);
return val;
}
// [[Rcpp::export]]
SEXP C_test3(SEXP f,SEXP x) {
Function fun(f);
return fun(x);
}
```
R code:
```
testFunc&l...
2004 Feb 17
2
interfacing C++ using .Call
...ned reference to
`Rf_isNewList(SEXPREC*)'
test.a(test.o.b)(.text+0x82):test.cpp: undefined reference to
`Rf_isFunction(SEXPREC*)'
test.a(test.o.b)(.text+0x99):test.cpp: undefined reference to
`Rf_isEnvironment(SEXPREC*)'
test.a(test.o.b)(.text+0xb7):test.cpp: undefined reference to
`Rf_lang2(SEXPREC*, SEXPREC*)'
test.a(test.o.b)(.text+0xc2):test.cpp: undefined reference to
`Rf_protect(SEXPREC*)'
test.a(test.o.b)(.text+0xcf):test.cpp: undefined reference to
`Rf_allocVector(unsigned, int)'
test.a(test.o.b)(.text+0xda):test.cpp: undefined reference to
`Rf_protect(SEXPREC*)&...
2009 Sep 03
1
Running an expression 1MN times using embedded R
...o();
R_registerRoutines(info, NULL, callMethods, NULL, NULL);
SEXP runner1,runner2;
PROTECT(runner1=rexpress("expression({ for(x in 1:5)
{ .Call('rh_status','x') }})"));
if (runner1 == R_NilValue){
UNPROTECT(1);
exit(1);
}
PROTECT(runner2=Rf_lang2(Rf_install("eval"),runner1));
if(runner2==NILSXP){
UNPROTECT(2);
exit(1);
}
int mapbuf_cnt = 0;
for(;;){
if(mapbuf_cnt >1000000) exit(0);
Rf_eval(runner2 ,R_GlobalEnv);
mapbuf_cnt++;
}
UNPROTECT(2);
}
2002 Jul 11
1
dyn.load tcl/tk (PR#1774)
....o
ld:
Warning: Unresolved:
fabs
sqrt
R_finite
Rf_error
R_GlobalEnv
R_NamesSymbol
Rf_coerceVector
Rf_allocMatrix
Rf_allocVector
Rf_asInteger
Rf_asLogical
Rf_asReal
Rf_eval
Rf_findVar
Rf_getAttrib
Rf_install
Rf_isEnvironment
Rf_isFunction
Rf_isNewList
Rf_isNumeric
Rf_isReal
Rf_isString
Rf_lang1
Rf_lang2
Rf_protect
Rf_setAttrib
Rf_unprotect
LENGTH
R_CHAR
STRING_ELT
VECTOR_ELT
SET_VECTOR_ELT
REAL
R_registerRoutines
mkdir -p -- ../../../../library/nls/libs
gmake[5]: Leaving directory `/soft/R/R-1.5.1/src/library/nls/src'
gmake[4]: Leaving directory `/soft/R/R-1.5.1/src/library/nls/src'
gmake[...