search for: rf_endembeddedr

Displaying 18 results from an estimated 18 matches for "rf_endembeddedr".

2006 Aug 31
2
stop R mainloop without calling exit(1)
Hello, I'm trying to make my Java application work with R, which involves sending and retrieving data and to run R functions from within the Java application. I also need to have "live interaction" with R, to show the R console output (e.g. warnings and print) and to enable the user to enter input when a function asks for it. Therefore I created a simple R console in Java using JRI
2012 Nov 14
2
R.dll Reference Guide?
Is there a reference guide to the complete set of functions and their arguments that are available in the R.dll library for Windows, i.e. the set of functions that includes "Rf_initEmbeddedR" and "Rf_endEmbeddedR" listed in section 8.2.2 of the Writing R Extensions manual? This may be more of an indictment of my lexical searching skills than anything else, but I was unable to turn up anything comprehensive after an hour with various search engines. -- View this message in context: http://r.789695...
2009 Sep 16
2
I want to get a reference to this time series object
...); PROTECT(c=R_tryEval(e,R_GlobalEnv,NULL)); PROTECT(e=lang3(install("["),install("SWX.RET"),c)); PROTECT(portData=R_tryEval(e,R_GlobalEnv,NULL)); PROTECT(e=lang2(install("print"),portData)); R_tryEval(e,R_GlobalEnv,NULL); UNPROTECT(3); Rf_endEmbeddedR(0); return 0; } [[alternative HTML version deleted]]
2010 Sep 09
0
calling Rf_initEmbeddedR error
...indFun(install("hreg"), R_GlobalEnv); if(fun == R_NilValue) // -----> success { UNPROTECT(1); throw std::range_error("R Function not found"); } SETCAR(e, fun); UNPROTECT(1); // End R R_dot_Last(); Rf_endEmbeddedR(0); R_gc(); ///////////////////////////// // Init R(second) Rf_initEmbeddedR(Argc2, Argv2); // R package load e = R_NilValue; r = R_NilValue; PROTECT(e = lang2(install("source"), mkString("hbnreg.R"))); r = R_tryEval(e, R_GlobalEnv...
2009 Mar 05
0
calling Rf_initEmbeddedR twice gives an error
Dear all, I've written a R to python/octave/r translator that (so you can call python from R etc and vice versa) enabling you to e.g. call matplotlib which just runs fine on the first command when I do Rf_initEmbeddedR(2, argv); Rf_endEmbeddedR(0); Rf_initEmbeddedR(2, argv); Rf_endEmbeddedR(0); I get this error Error in .Call("R_isMethodsDispatchOn", onOff, PACKAGE = "base") : Incorrect number of arguments (2), expecting 1 for R_isMethodsDispatchOn Error in gzfile(file) : invalid 'encoding' argume...
2006 Aug 31
1
Overriding InitTempDir
For embedded projects, one may want to eliminate the per-session temp directory created by InitTempDir() and just use a system-specific temp directory. Here's my solution: extern char *R_TempDir; void my_InitTempDir() { char *tmp; if (R_TempDir){ if (rmdir(R_TempDir) != 0){ perror("Fatal Error: could not remove R's TempDir!");
2007 Apr 07
2
Rf_PrintValue problem with methods::show
...ds[i]); PROTECT(e = R_ParseVector(mkString(cmds[i]), -1, &status, R_NilValue)); val = eval(VECTOR_ELT(e, 0), R_GlobalEnv); printf("** I **: Evaluation succeeded, now printing using Rf_PrintValue:\n"); Rf_PrintValue(val); UNPROTECT(1); } Rf_endEmbeddedR(0); return 0; } $ $ gcc -o parseEvalS4 \ > `${RPROG} CMD config --cppflags` \ > `${RPROG} CMD config --ldflags` parseEvalS4.c $ $ ${RPROG} CMD ./parseEvalS4 --vanilla --silent ** I **: Executing command: show(5) [1] 5 ** I **: Evaluation succeeded, now printing using Rf_Pri...
2013 Oct 16
1
Parallel R expression evaluations
...} } UNPROTECT(2); I wonder if R supports parallel evaluations within a single session. I have seen parallel evaluations of R using Rserve package. As I am trying to overcome the overhead (using Rserve) in creating new connection for each evaluation, here I am trying using embeded R. I tried Rf_endEmbeddedR each time after one evaluation and initializing R for the next set of evaluation. Even that did't work. Please suggest me possible solution if any. Thanks in advance. Jai -- View this message in context: http://r.789695.n4.nabble.com/Parallel-R-expression-evaluations-tp4678352.html Sen...
2009 Jan 08
1
Callbacks seems to get GCed.
...- function (f) { .Call(\"set_callback2\",f); }"); r_exec("x(function() { print(\"A\"); })"); r_exec("y(function() { print(\"B\"); })"); for (i = 0; i < 100000; i++) { r_trigger_callback1(); r_trigger_callback2(); } Rf_endEmbeddedR(0); } -- Bernd Schoeller, PhD, CTO Comerge AG, Technoparkstrasse 1, CH-8055 Zurich, www.comerge.net
2012 Apr 18
1
C - R integration: Memory Issues
...= R_tryEval(e, R_GlobalEnv, &errorOccurred); if (errorOccurred) { printf("error occurred in mean\n"); } for (i = 0; i < berValues; i++) { REAL(bers)[i] = REAL(bers)[i] / REAL(mean)[0]; } *ber = REAL(mean)[0]; Rf_endEmbeddedR(0); UNPROTECT(3); return 0; } And these are the errors from Valgrind output: HEAP SUMMARY: ==2909== in use at exit: 18,832,260 bytes in 6,791 blocks ==2909== total heap usage: 21,758 allocs, 14,967 frees, 30,803,476 bytes allocated ==2909== ==2909== 160 (40 direct, 120...
2009 Sep 29
3
How do I access class slots from C?
...uch is writted on this in the R extensions manual. PROTECT(e=lang3(install("setWeights"),portSpec,portWeights)); PROTECT(portSpec=R_tryEval(e,R_GlobalEnv,NULL)); PROTECT(e=lang2(install("print"),portSpec)); R_tryEval(e,R_GlobalEnv,NULL); UNPROTECT(3); Rf_endEmbeddedR(0); return 0; } Regards Abhijit Bera [[alternative HTML version deleted]]
2015 Feb 05
0
How to unload R.dll successfully by FreeLibrary
...s since it is trying to Initialize R again(this is not allowed as documented). Anyone can tell me why, thanks. //the following is my c++ code, used in a Visual Studio 2012 Console Application #define ORAPI__cdecl typedefBOOL(ORAPI*PFN_Rf_initEmbeddedR)(int argc, char *argv[]); typedefvoid(ORAPI*PFN_Rf_endEmbeddedR)(int fatal); staticvoid_simple_test() { #define STR_R_DLL_PATH_T("D:\\R\\R-3.1.2\\bin\\i386\\R.dll") HMODULEm_hRDll = LoadLibrary(STR_R_DLL_PATH); if ( m_hRDll ) { PFN_Rf_initEmbeddedR pfnInit = (PFN_Rf_initEmbeddedR)GetProcAddress(m_hRDll, "Rf_initEmbeddedR"); PFN_Rf_endEmbed...
2007 Aug 16
0
call R function in c++ program
...tor...) Until now, my program work for simple function ("plot", "rnorm"...) but I can't use library My class are : // in constructor int argc = 1; char *argv[] = {"wxR"}; Rf_initEmbeddedR(argc, argv); rho = R_GlobalEnv; // in destructor Rf_endEmbeddedR(0); // for translate std::vector to SEXP VECTOR // std_vector are defined as "vector<double>" and iterator as "vector<double>::iterator" PROTECT( vector_SEXP = allocVector(REALSXP, std_vector.size()) ); int i = 0; for(std_iterator s_it=std_vector.begi...
2010 Mar 27
3
Calling R from c in Windows XP
I'm searching for answers to four questions (I've been searching the net for hours...) In Windows XP, is it possible to call R functions from a c program? (I've found examples for Linux/Unix but not Windows) If so, is there a simple example to get started using gcc with R-2.10.0? If so, is it possible to write a simple interface using a c dll to call R functions from a Visual
2011 Mar 08
3
How to disable R's crash prompt
Dear R devel, I have a C++ app that calls into embedded R to perform some analytic calculations. When my app encounters a segmentation fault, R always prints the following crash prompt and asks me to enter an action: *** caught segfault *** address 0x8, cause 'memory not mapped' Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace
2010 May 06
1
R on kdeedu-svn library problem
...nce to `Rf_initEmbeddedR' $SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:85: undefined reference to `R_ReplDLLinit' CMakeFiles/cantor_rserver.dir/rserver.o: In function `RServer::endR()': $SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:194: undefined reference to `Rf_endEmbeddedR' CMakeFiles/cantor_rserver.dir/rcallbacks.o: In function `setupCallbacks(RServer*)': $SOURCES/kdeedu/cantor/src/backends/R/rserver/rcallbacks.cpp:40: undefined reference to `R_Outputfile' $SOURCES/kdeedu/cantor/src/backends/R/rserver/rcallbacks.cpp:41: undefined reference to `R_Conso...
2006 Oct 03
1
R-2.4.0 is released
...d have given rise to obscure garbage collection errors. o allocString is now a macro, so packages using it will need to be reinstalled. o R_ParseVector was returning with object(s) protected in the parser if the status was PARSE_INCOMPLETE or PARSE_ERROR. o There is a new function Rf_endEmbeddedR to properly terminate a session started by Rf_initEmbeddedR, and both are now available on Windows as well as on Unix-alikes. These and related functions are declared in a new header <Rembedded.h>. If R_TempDir is set when embedded R is initialized it is assumed to point to a valid ses...
2006 Oct 03
1
R-2.4.0 is released
...d have given rise to obscure garbage collection errors. o allocString is now a macro, so packages using it will need to be reinstalled. o R_ParseVector was returning with object(s) protected in the parser if the status was PARSE_INCOMPLETE or PARSE_ERROR. o There is a new function Rf_endEmbeddedR to properly terminate a session started by Rf_initEmbeddedR, and both are now available on Windows as well as on Unix-alikes. These and related functions are declared in a new header <Rembedded.h>. If R_TempDir is set when embedded R is initialized it is assumed to point to a valid ses...