[Rd] Build a R call at C level
morg@n@em@||box @end|ng |rom gm@||@com
Tue Jun 30 11:08:10 CEST 2020
I was reading the R extension manual section 5.11 ( Evaluating R expression
from C) and I tried to build a simple call to the sum function. Please see
call_to_sum <- inline::cfunction(
language = "C",
sig = c(x = "SEXP"), body = "
SEXP e = PROTECT(lang2(install(\"sum\"), x));
SEXP ans = PROTECT(eval(e, R_GlobalEnv));
The above works. My question is how do I add the argument "na.rm=TRUE" at C
level to the above call? I have tried various things based on what is in
section 5.11 but I did not manage to get it to work.
[[alternative HTML version deleted]]
More information about the R-devel