search for: rf_instal

Displaying 20 results from an estimated 27 matches for "rf_instal".

Did you mean: rf_install
2004 Oct 08
2
R-2.0.0 findVar and findFun question
.....) : Invalid generic function in usemethod Alternatively, using Rf_findFun(...) seems OK in this context, but crashes if you call it with an unexisting function name. Rf_findVar does not crash in this case, but returns an unbound value. My workaround for now is as follows: fun = Rf_findVar(Rf_install(ident), R_GlobalEnv); if (fun != R_UnboundValue) { fun = Rf_findFun(Rf_install(ident), R_GlobalEnv); R_tryEval(fun, ...); } I did some checking on the R object pointers and indeed for generic functions Rf_findFun and Rf_findVar return different pointers (and therefore diff...
2012 Sep 15
1
Question about copying arguments in C.
...thingysIntegermust be an integer."); if(constructThingy(INTEGER(thingysInteger)[0])) error("error in getting a thingy"); TClass = MAKE_CLASS("thingy"); PROTECT(ans = NEW_OBJECT(TClass)); // *****QUESTION STARTS HERE***** // CAN I SAY: SET_SLOT(ans, Rf_install("myInteger"), thingysInteger); // IF NOT, CAN I SAY SET_SLOT(ans, Rf_install("myInteger"), AS_INTEGER(thingysInteger)); // OR DO I NEED TO SAY PROTECT(ti = allocVector(INTSXP, 1)); INTEGER(pns)[0] = INTEGER(thingysInteger)[0]; SET_SLOT(ans, Rf_install(&quo...
2009 Nov 13
0
Problem building R 2.10 release
...think it is because I built the lapack libraries using intel compilers. sparseQR.o: In function `sparseQR_coef': sparseQR.c:(.text+0x52a): undefined reference to `Rf_protect' sparseQR.c:(.text+0x53a): undefined reference to `Rf_install' sparseQR.c:(.text+0x54f): undefined reference to `R_do_slot' sparseQR.c:(.text+0x55f): undefined reference to `Rf_install' sparseQR.c:(.text+0x574): undefined reference to `R_do_slot' sparseQ...
2020 Mar 24
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
...lEnv); Good catch. And recursive grep for Rf_lang2 in the Rcpp sources tree suggests this is as the common pattern in all other instances. Dirk edd at rob:~/git/rcpp(master)$ ag Rf_lang2 inst/include/ inst/include/Rcpp/exceptions.h 360: Rcpp::Shield<SEXP> simpleErrorExpr(Rf_lang2(::Rf_install("simpleError"), txt)); 365: Rcpp::Shield<SEXP> simpleErrorExpr( Rf_lang2(::Rf_install("simpleError"), tryError )); 388: Rcpp::Shield<SEXP> expr( Rf_lang2( stop_sym , condition ) ) ; 395: Rcpp::Shield<SEXP> expr( Rf_lang2( stop_sym , condition ) )...
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: > > > On 23 March 2020 at 17:07, Ben Bolker wrote: >
2023 Nov 11
1
New syntax for positional-only function parameters?
6 ?????? 2023 ?. 22:54:24 GMT+03:00, mikkmart via R-devel <r-devel at r-project.org> ?????: >The pattern of functions accepting other functions as inputs and >passing additional ... arguments to them is prevalent throughout >the R ecosystem. Currently, however, all such functions must one >way or another tackle the problem of inadvertently passing arguments >meant to go to
2010 May 06
1
R on kdeedu-svn library problem
...ference to `Rf_length' CMakeFiles/cantor_rserver.dir/rserver.o: In function `RServer::autoload()': $SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:137: undefined reference to `R_GlobalEnv' $SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:137: undefined reference to `Rf_install' $SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:137: undefined reference to `Rf_findFun' $SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:137: undefined reference to `Rf_protect' $SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:138: undefined reference t...
2004 Feb 11
1
About the macro defined in Rinternals.h
Hello everyone, I try to write a c++ code which calls embedded R and uses some of R internal functions. What I read is just lots of macro names defined in the Rinternals.h or Rdefines like R_Parse, Rf_install and so on. But where can I get the detailed information about the parameters of these macro? For example, what about the parameters of SEXP R_ParseVector(SEXP, int, ParseStatus *)? Thank you very much! Baiyi Song Computer Engineering Institute Dortmund Univercity
2012 Apr 16
1
eval a SYMSXP from C
...,mu) { attr(x,"mu") <- substitute(mu) x } mu <- 2.0 xn <- foo(rnorm(100),mu) > typeof(attr(xn,"mu")) [1] "symbol" > eval(attr(xn,"mu")) [1] 2 > In a .Call, I am attempting to eval the SYMSXP as follows: SEXP mu_ = Rf_getAttrib(x_,Rf_install("mu")); if(TYPEOF(mu_)==SYMSXP) { mu_ = Rf_eval(Rf_lang1(mu_),R_GlobalEnv); } However, when running this code, I get the following error: Error in logp(xn) : could not find function "mu" Do I need to create an expression of c("get", "mu") to force the n...
2007 Sep 20
1
copying promise
1. Is there some way to copy a promise so that the copy has the same expression in its promise as the original. In the following we y is a promise that we want to copy to z. We want z to be a promise based on the expression x since y is a promise based on the expression x. Thus the answer to the code below is desired to be z=2 but its 1, 1 and y in the next three examples so they are not the
2006 Nov 27
1
R.DLL mapping by P/Invoke
...Convention.Cdecl,*/ CharSet = CharSet.Ansi)] static extern IntPtr R_tryEval(IntPtr exp, IntPtr env, out int evalError); //- R Symbols [DllImport("R.DLL", /*CallingConvention = CallingConvention.Cdecl,*/ CharSet = CharSet.Ansi)] static extern IntPtr Rf_install(string name); [DllImport("R.DLL", /*CallingConvention = CallingConvention.Cdecl,*/ CharSet = CharSet.Ansi)] static extern IntPtr Rf_findVar(IntPtr symbol, IntPtr env); [DllImport("R.DLL", /*CallingConvention = CallingConvention.Cdecl,*/ CharSet = CharSet...
2007 Oct 17
0
Using R.dll in .NET IPC
...Convention.Cdecl,*/ CharSet = CharSet.Ansi)] static extern IntPtr R_tryEval(IntPtr exp, IntPtr env, out int evalError); //- R Symbols [DllImport("R.DLL", /*CallingConvention = CallingConvention.Cdecl,*/ CharSet = CharSet.Ansi)] static extern IntPtr Rf_install(string name); [DllImport("R.DLL", /*CallingConvention = CallingConvention.Cdecl,*/ CharSet = CharSet.Ansi)] static extern IntPtr Rf_findVar(IntPtr symbol, IntPtr env); [DllImport("R.DLL", /*CallingConvention = CallingConvention.Cdecl,*/ CharSet = CharSet...
2002 Jun 03
1
build fails dumping R code in 'methods' on i686-pc-linux-gnu (PR#1630)
...code is only executed when dumping > assign(".saveImage", FALSE, .GlobalEnv) > .First.lib("methods", "methods", .GlobalEnv) $ ../../../bin/R --debugger=gdb (gdb) run --vanilla < all.R [...] Program received signal SIGSEGV, Segmentation fault. 0x403cb10d in Rf_install () from /mnt/Data/src/install/R-1.5.0/bin/libR.so (gdb) where #0 0x403cb10d in Rf_install () from /mnt/Data/src/install/R-1.5.0/bin/libR.so #1 0x404f5a85 in R_initMethodDispatch () from /mnt/Data/src/install/R-1.5.0/library/methods/libs/methods.so #2 0x807c6a2 in do_dotCode () at eval.c:88 #...
2004 Aug 18
3
R as shared library
...code: /* override to call apache library write routine */ ptr_R_WriteConsole = Rapache_WriteConsole; /* load source(). I assume this is appropriate. I could always move this to the code that handles the requst */ PROTECT(R_source_fun = allocVector(LANGSXP, 2)); SETCAR(R_source_fun, Rf_install("source")); SETCAR(CDR(R_source_fun), R_source_arg = NEW_CHARACTER(1)); Then each request is serviced by the following code: /* r is apache request, r->filename is url translated to apsolute path to filename */ SET_STRING_ELT(R_source_arg, 0, COPY_TO_USER_STRING(r->fil...
2009 Sep 03
1
Running an expression 1MN times using embedded 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); }
2010 Feb 20
1
how to create a SEXP which could be accessed in embedded R
Hi all, I am not familiar with writing R extensions. In a C program, I want to create a SEXP and access it in embedded R. How to let the embedded engine know there's a new vector? For example, after creating a SEXP, parsing 'ls()' in embedded R and then evaluating, STRSXP returned will contain the name of the SEXP. Any help would be appreciated. Regards, Spiral [[alternative HTML
2002 Jan 02
1
Building R-1.4 on Tru64
...titute_direct.o methods_list_dispatch.o method_meta_data.o slot.o -L/usr/local/lib /usr/ucb/ld: Warning: Unresolved: TYPEOF Rf_error Rf_protect Rf_substitute Rf_unprotect Rf_duplicate Rf_VectorToPairList R_NilValue Rf_NewEnvironment R_set_standardGeneric_ptr R_GlobalEnv R_set_quick_method_check Rf_install Rf_allocVector LOGICAL R_PreserveObject Rf_mkChar SET_STRING_ELT Rf_findVar R_UnboundValue VECTOR_ELT R_NamesSymbol Rf_getAttrib Rf_length STRING_ELT R_CHAR R_do_slot Rf_asChar PRINTNAME Rf_isNull CAR CDR R_data_class Rf_isFunction Rf_findFun SETCAR Rf_eval INTEGER CLOENV Rf_findVarInFrame Rf_isSy...
2003 Mar 18
0
all.rda again
...l.rda] Error 139 make: *** [all] Error 2 If I move to src/library/methods and do setenv R_DEFAULT_PACKAGES NULL ../../../bin/R --vanilla --slave < all.R I get initializing class and method definitions now ...Segmentation fault and the console tells me Thread 0 Crashed: #0 0x0185095c in Rf_install (names.c:1024) #1 0x01827d64 in R_execMethod (eval.c:721) #2 0x013d6c38 in R_standardGeneric (methods_list_dispatch.c:630) #3 0x00082d60 in do_standardGeneric (objects.c:1013) #4 0x00057188 in Rf_eval (eval.c:441) #5 0x00058f40 in do_set (eval.c:1281) #6 0x00056fcc in Rf_ev...
2011 Jan 11
0
[Rcpp-devel] Loading a package using Rcpp Modules results in memory corruption
...t;>>>>>>> much for >>>>>>>> Rcpp. >>>>>>>> >>>>>>> >>>>>>> I don't think so. In the situation that Dominick is describing the C >>>>>>> API is being used (calls to Rf_install, Rf_lang1, Rf_eval, ...) and >>>>>>> you have to play by the rules of the C API. Essentially every time >>>>>>> that you call a function in the C API that can cause a memory >>>>>>> allocation you are open yourself to the possibility o...
2003 Mar 17
1
R-devel on Darwin
...hen trying to start R. Date/Time: 2003-03-16 17:38:30 -0800 OS Version: 10.2.5 (Build 6L11) Host: cabledoc116.frazmtn.com Command: R.bin PID: 15739 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x7c1d0010 Thread 0 Crashed: #0 0x0149995c in Rf_install (names.c:1024) #1 0x00fe3cc0 in R_initMethodDispatch (methods_list_dispatch.c:92) #2 0x00043d04 in do_dotCode (dotcode.c:1311) #3 0x00057188 in Rf_eval (eval.c:441) #4 0x00057614 in Rf_applyClosure (eval.c:609) #5 0x00057200 in Rf_eval (eval.c:453) #6 0x00058810 in do_begin...