search for: cmethod

Displaying 7 results from an estimated 7 matches for "cmethod".

Did you mean: method
2012 Feb 06
1
Segfault on ".C" registration via R_CMethodDef according to 'Writing R Extensions'.
...encountered a serious problem regarding the registration of ".C" when following the documentation "Writing R Extensions" that leads to a segmentation fault (tested on windows and mac os x). The registration mechanism for ".C" routines via R_registerRoutines and the R_CMethodDef structure has been enhanced recently with the addition of two fields, one for type specification and the other for the style (in, out, inout or irrelevant). According to the manual 'Writing R Extensions' of version 2.14.1 an example is given that specifies to use the fourth field (type...
2003 Dec 09
1
R Interface handholding
...\n"); return returner; } I've made this into a package, by dropping it into a stub directory along with something called init.c: #include "areone.h" #include <R_ext/Rdynload.h> #include <Rinternals.h> R_NativePrimitiveArgType myincr_t[1] = {INTSXP}; static const R_CMethodDef cMethods[] = { {"myincr", (DL_FUNC) &myincr, 1, myincr_t} }; void R_init_myincr(DllInfo* dll) { R_registerRoutines(dll, cMethods, NULL, NULL, NULL); } R is happy to install this for me, but after doing a library(myincr), the function doesn't seem to be...
2007 Mar 19
3
Rinternals.h and undefined symbols
Hi, I'm trying to register my native routines using R_registerRoutines (...). I can compile the code, but the loader cannot resolve the symbol: undefined symbol: _Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6 _ $ nm bgx.Rcheck/bgx/libs/bgx.so | grep R_registerRoutines U _Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6 _ Why does it have this funny name? If I look at libR.so, I get an ordinary symbol name: $ nm ~/lib64/R/lib/li...
2009 Jan 08
1
Callbacks seems to get GCed.
...> #include <R_ext/Parse.h> #include <R_ext/Rdynload.h> #include <R_ext/RStartup.h> #include <Rinterface.h> SEXP callback1; SEXP callback2; void set_callback1(SEXP func) { PROTECT(callback1 = func); } void set_callback2(SEXP func) { PROTECT(callback2 = func); } R_CMethodDef cMethods[] = { {NULL} }; R_CallMethodDef callMethods[] = { {"set_callback1", (DL_FUNC) &set_callback1, 1}, {"set_callback2", (DL_FUNC) &set_callback2, 1}, {NULL} }; void r_trigger_callback1() { int errorOccurred; SEXP f = NULL; f = allocVector(...
2018 Feb 16
0
Competing risks - calibration curve
...,1))) #plot(nom.sur, fun.side=list(rep(1,10), c(1,1,1,1,3,1,3,1,3,1,3,1,3,1,3,1), rep(1,10), rep(1,10))) #table(status) ########################### #or f <- psm(S ~ ...) pa <- 'polspline'%in% row.names(installed.packages()) if(pa) { cal <- calibrate(mod, u=2.5, m=20, B=20) # cmethod= ' hare ' plot(cal) } #################################### # validate v<-validate(mod, method='boot', B=5) v #################################### #################################### # Calibration set.seed(717) cal<-calibrate(mod, method="boot&quot...
2007 Apr 04
1
Accessing C++ code from R
...ed ';' before 'const' /usr/include/c++/4.0.0/bits/codecvt.h:220: error: expected `;' before 'int' main.cpp:51: error: brace-enclosed initializer used to initialize 'R_NativePrimitiveArgType*' Line 51 refers to the standard part to register the function in R: R_CMethodDef cMethods[] = { {"runSimulation", (void* (*) ()) &runSimulation, 27, {INTSXP, INTSXP, INTSXP, REALSXP, REALSXP, REALSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, REALSXP, REALSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, INTSXP, REALSXP, REALS...
2007 May 01
1
Embedding R and registering routines
Hello, The use of .Call and the like all depend on loading shared libraries and registering routines from it. Also, .Primitive and .Internal depend on routines being registered in the R binary. And applications that embed R can override routines declared in Rinterfac.h, but is there a way for an application embedding R to register other routines defined in the application without loading a