search for: setcaddr

Displaying 4 results from an estimated 4 matches for "setcaddr".

Did you mean: sectaddr
2009 May 26
1
passing "..." arguments to a function called by eval()
...dTestC(SEXP dblX, SEXP funFn, SEXP dots, SEXP rho); /*--------------------------*/ SEXP dTestC(SEXP dblX, SEXP funFn, SEXP dots, SEXP rho){ SEXP retVal; SEXP R_fcall; PROTECT(retVal = NEW_NUMERIC(1)); PROTECT(R_fcall = lang3(funFn, R_NilValue, R_NilValue)); SETCADR(R_fcall, dblX); SETCADDR(R_fcall, dots); retVal = eval(R_fcall, rho); UNPROTECT(2); return(retVal); } ######################## When I call the dTest() function, the first required argument and the first optional argument are both used, but not the ones after that. I'm modeling this after what I found in the...
2003 Nov 03
2
lang2(...) with two and more arguments
Dear R-help, how could I create an R call in C code using lang2 with 2 and more arguments? I tried this code: SEXP f(SEXP fn, SEXP rho) { SEXP R_fcall, x, y; PROTECT(R_fcall = lang2(fn, R_NilValue)); PROTECT(x = allocVector(REALSXP, 1)); PROTECT(y = allocVector(REALSXP, 1)); REAL(x)[0] = 10; REAL(y)[0] = 20; SETCADR(R_fcall, x); SETCADR(R_fcall, y);
2019 Sep 27
2
Evaluate part of an expression at C level
Hi, I am wondering if the below is possible? Let's assume I have the following expression: 1:10 < 5 Is there a way at the R C API level to only evaluate the 5th element (i.e 5 < 5) instead of evaluating the whole expression and then select the 5th element in the logical vector? Thank you Best regards Morgan [[alternative HTML version deleted]]
2008 Apr 29
2
Calling R from C - part way there but need a push!
Dear All, I've read the manual on "Writing R Extensions" and in particular the part on calling R from C. (Most of the manual is about calling C from R, not the other way around.) The good news is that I can now call _some_ R from C, specifically the R functions which have C header files. However it isn't clear to me how to call R functions that are written in R. I