search for: r_true

Displaying 6 results from an estimated 6 matches for "r_true".

2020 Jun 30
3
Build a R call at C level
...ferred for this kind > of questions. > Not sure if that is the best way, but works. > > call_to_sum <- inline::cfunction( > language = "C", > sig = c(x = "SEXP"), body = " > > SEXP e = PROTECT(lang2(install(\"sum\"), x)); > SEXP r_true = PROTECT(CONS(ScalarLogical(1), R_NilValue)); > SETCDR(CDR(e), r_true); > SET_TAG(CDDR(e), install(\"na.rm\")); > Rf_PrintValue(e); > SEXP ans = PROTECT(eval(e, R_GlobalEnv)); > UNPROTECT(3); > return ans; > > ") > > call_to_sum(c(1L,NA,3L)) > > O...
2020 Jun 30
2
Build a R call at C level
Hi All, 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 below. 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)); UNPROTECT(2); return
2020 Jun 30
0
Build a R call at C level
...ll R-package-devel mailing list should be preferred for this kind of questions. Not sure if that is the best way, but works. call_to_sum <- inline::cfunction( language = "C", sig = c(x = "SEXP"), body = " SEXP e = PROTECT(lang2(install(\"sum\"), x)); SEXP r_true = PROTECT(CONS(ScalarLogical(1), R_NilValue)); SETCDR(CDR(e), r_true); SET_TAG(CDDR(e), install(\"na.rm\")); Rf_PrintValue(e); SEXP ans = PROTECT(eval(e, R_GlobalEnv)); UNPROTECT(3); return ans; ") call_to_sum(c(1L,NA,3L)) On Tue, Jun 30, 2020 at 10:08 AM Morgan Morgan <morgan....
2020 Jun 30
0
Build a R call at C level
...> > Not sure if that is the best way, but works. > > > > call_to_sum <- inline::cfunction( > > language = "C", > > sig = c(x = "SEXP"), body = " > > > > SEXP e = PROTECT(lang2(install(\"sum\"), x)); > > SEXP r_true = PROTECT(CONS(ScalarLogical(1), R_NilValue)); > > SETCDR(CDR(e), r_true); > > SET_TAG(CDDR(e), install(\"na.rm\")); > > Rf_PrintValue(e); > > SEXP ans = PROTECT(eval(e, R_GlobalEnv)); > > UNPROTECT(3); > > return ans; > > > > ") > &...
2002 Jul 02
3
interfacing R and c++
Hi, I'm trying to write a gui program that accesses some R code I've written. The gui is written in c++ and includes qt libraries and vigra libraries (for image manipulation). Unfortunately I've been getting dependencies due to constants getting redefined within the R.h/R_ext library and Rinternals.h. I tried rewriting the R interface but the problem keeps propagating. I've been
2002 Jul 02
3
interfacing R and c++
Hi, I'm trying to write a gui program that accesses some R code I've written. The gui is written in c++ and includes qt libraries and vigra libraries (for image manipulation). Unfortunately I've been getting dependencies due to constants getting redefined within the R.h/R_ext library and Rinternals.h. I tried rewriting the R interface but the problem keeps propagating. I've been