search for: rf_initembeddedr

Displaying 20 results from an estimated 57 matches for "rf_initembeddedr".

2010 Sep 09
0
calling Rf_initEmbeddedR error
Hi all, I have a problem of Rf_initEmbeddedR function. I've tried with: try { int Argc1 = 1; char *Argv1[] = {"Rtest_1"}; int Argc2 = 1; char *Argv2[] = {"Rtest_2"}; // Init R(first) Rf_initEmbeddedR(Argc1, Argv1); // R package load SEXP e = R_NilValue; SEXP r...
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) : inv...
2005 Sep 22
1
Rf_initEmbeddedR in Windows
Hi All My C++/linux program uses Rf_initEmbeddedR to start R and then calls some R functions. Now I try to port it to Windows. Give the fact that Rf_initEmbeddedR is missing in Windows, I try to use the implmentation in Rserve by Simon Urbanek. When I build in MS Visual Studio, I get the following linking error error LNK2019: unresolved external...
2007 Oct 13
1
R API - optim
I am trying to use the R API to call optim functions (nmmin, vmmin, lbfgsb, etc.) through a C program but I couldn't find the shared library to link under the R-2.6.0 build which is compiled under Linux (REL5). main.cpp:35: undefined reference to `Rf_initEmbeddedR(int, char**)' main.cpp:41: undefined reference to `nmmin' Thanks in advance for any help. ------------------------ #include <R_ext/Applic.h> #include <R.h> #include <stdio.h> double parabola(int n, double *par, void *ex) { double xm = par[0] - 1; return xm * xm + 13...
2015 Aug 20
2
Child thread libR.so
...------- my code is as follows ---------------------------------------- SNIP ------------------------------------------------------------------------------ void init_r() { SEXP aperm_function; const char *init_argv[] = {"MyFront", "--vanilla", "--slave"}; Rf_initEmbeddedR(sizeof (init_argv) / sizeof (init_argv[0]), (char**) init_argv); R_CStackLimit = (uintptr_t)-1; /* * transposeVector above uses the R builtin function aperm instead of * looking it up every time we need deal with transposing a multidimensional * intput/output look it up onc...
2015 Aug 25
0
Child thread libR.so
Simon, Ah, thank you! quiet right. For anyone searching for this in the future, I changed my init fuction to: ---------- SNIP ---------------- void init_r() { SEXP aperm_function; /* this is our version of Rf_initEmbeddedR where we disable stack checking */ const char *init_argv[] = {"MyFront", "--vanilla", "--slave"}; Rf_initialize_R(sizeof (init_argv) / sizeof (init_argv[0]), (char**) init_argv); /* Disable stack limit checking since it is incompatible being loaded on a ch...
2018 Oct 01
1
unexpected memory.limit on windows in embedded R
Dear All, I'm linking R from another application and embedding it as described in the R-exts manual, i.e. with initialization done via Rf_initEmbeddedR. While everything works the same as in standalone R for Linux, under Windows I found a difference in the default memory.limit, which is fixed to 2GB (both win32 and win64) - compared to a limit in standalone R of 3.5GB for win32 and 16GB on win64 (which is the amount of physical memory I have). So...
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 mes...
2007 Jul 04
2
problem with findFun call from embedded R
...c? ========================== On a related note, I found during my PL/R debugging that the segfault was causing the same console based, interactive, "*** caught segfault ***" logic to execute. I was able to confirm that R_Interactive was set to TRUE in my PL/R session. It seems that Rf_initEmbeddedR() sets R_Interactive to TRUE and depends on the output of isatty() to change it to FALSE in Rf_initialize_R() if there is no tty. Unfortunately, the most common methods for starting Postgres leave the tty attached (stdout and stderr are directed to the log file). I ended up explicitly writing &...
2010 Jan 30
2
Stop packages and datasets to be loaded on startup.
...#39;s instead. see autoloads(). > */ > if (setenv("R_DEFAULT_PACKAGES","NULL",1) != 0){ > perror("ERROR: couldn't set/replace R_DEFAULT_PACKAGES"); > exit(1); > } The code above happens before Rf_initEmbeddedR in littler. So I gather that just setting R_DEFAULT_PACKAGES to NULL should be OK. But then, what is the rather complicated stuff in the autoload() function in littler.c for? And concerning datasets, how do you avoid loading them? All the best, -- Guillaume Yziquel http://yziquel.homel...
2015 Aug 24
0
Child thread libR.so
...CStackOverflow (usage=140732197147604) at errors.c:81 #1 0x00002aaaab0625b7 in Rf_eval (e=0x1b7592a8, rho=0x1b753960) at eval.c:545 #2 0x00002aaaab0871ca in R_ReplFile (fp=0x1b69a830, rho=0x1b753960) at main.c:98 #3 0x00002aaaab087a27 in setup_Rmainloop () at main.c:861 #4 0x00002aaaab14a98b in Rf_initEmbeddedR (argc=<value optimized out>, argv=<value optimized out>) at Rembedded.c:63 On Thu, Aug 20, 2015 at 1:21 PM, Ryan C Metzger <metzger.rc at gmail.com> wrote: > So I'm working on a custom front end to R, in one mode of the front > end I dynamically load libR.so into a chil...
2009 Sep 16
2
I want to get a reference to this time series object
...lude <stdio.h> #include <R.h> #include <Rinternals.h> #include <Rdefines.h> #include <Rembedded.h> int main(int argc, char** argv) { SEXP e,c,portSpec,portData,portConstr,portVal,tsAssets; int errorOccurred,nx,ny,i,j; double *v; const char *x,*y; Rf_initEmbeddedR(argc, argv); // loading fPortfolio PROTECT(e = lang2(install("library"), mkString("fPortfolio"))); R_tryEval(e, R_GlobalEnv, NULL); UNPROTECT(1); // creating a default portfolioSpec object PROTECT(e=lang1(install("portfolioSpec"))); PROTE...
2008 Jan 02
1
setting the seed in standalone code using Rlib
...llocVector(STRSXP, 1)); SET_STRING_ELT(cmdSexp, 0, mkChar(cmd)); cmdExp = PROTECT(R_ParseVector(cmdSexp, -1, &status, R_NilValue)); assert(status == PARSE_OK); eval(VECTOR_ELT(cmdExp, 0), R_GlobalEnv); UNPROTECT(2); #else set_seed(seed, seed); #endif } /* Test */ extern int Rf_initEmbeddedR(int argc, const char *argv[]); int main(int numArgs, char** args) { const char *argv[]= {"setseed", "--gui=none", "--silent"}; const int argc = 3; Rf_initEmbeddedR(argc, argv); setSeed((unsigned int)42); printf("%f\n", rnorm(0.0, 1.0)); return...
2008 Mar 07
1
Build options for R
...rying to disable R >from requiring --save, --no-save or --vanilla... Is there any way to >build R on linux and disable R from asking --save, --no-save or --vanilla?? I received this reply from someone... >If you are calling libR.so, it is an option set when you initialize R. >See Rf_initEmbeddedR in 'Writing R Extensions' and the examples in the tests/Embedded directory in the sources. >BTW, discussion of embedded R is definitely off topic for R-help: use the R-devel list. Now my question is. Is there any way to modify the source so that I can force R to use the --no-save op...
2004 Jun 11
1
bug or correct behaviour ?
This is the general outline of my code:: main(argc,argv){ ... Rf_initEmbeddedR(argc,argv); ... Test_tryEval("source(test.r)"); ... } ############# # test.r ############# ... dyn.load("toload.so") tmp <-matrix(data=1,nrow=narray*2,ncol=nclust) .Call("Init",tmp,...) while(...) { criteria <-feval(tmp) if (criteria < criter...
2006 Aug 31
1
Overriding InitTempDir
...= NULL) tmp = "/tmp"; } } R_TempDir=tmp; if (setenv("R_SESSION_TMPDIR",tmp,1) != 0){ perror("Fatal Error: couldn't set/replace R_SESSION_TMPDIR!"); exit(1); } } This function is called after Rf_initEmbeddedR; it's seems like a hack but it works. Does anyone have other solutions? Maybe InitTempDir could check if R_TempDir was not NULL and then just return. -- http://biostat.mc.vanderbilt.edu/JeffreyHorner
2007 Apr 07
2
Rf_PrintValue problem with methods::show
...ernals.h> #include <Rembedded.h> #include <R_ext/Parse.h> int main(int argc, char *argv[]) { SEXP e, val; int i, errorOccurred; ParseStatus status; char *cmds[] = { "show(5)", "show(cbind2)", "cbind2" }; argv[0] = "R"; Rf_initEmbeddedR(argc, argv); for (i = 0; i < 3; i++) { printf("** I **: Executing command: %s\n", cmds[i]); PROTECT(e = R_ParseVector(mkString(cmds[i]), -1, &status, R_NilValue)); val = eval(VECTOR_ELT(e, 0), R_GlobalEnv); printf("** I **: Evaluation succe...
2009 Aug 25
2
Clarifications please.
...ke Covariance <- round(cov(100 * SWX.RET), digits = 4) using lang, install and R_tryEval. 2) What exactly does install do? 3) I wrote the following code: #include <Rinternals.h> #include <Rembedded.h> int main (int argc, char** argv) { SEXP e,val; int errorOccurred; Rf_initEmbeddedR(argc, argv); // library("fPortfolio") PROTECT(e = lang2(install("library"), mkString("fPortfolio"))); R_tryEval(e, R_GlobalEnv, NULL); UNPROTECT(1); // colMeans(SWX.RET) PROTECT(e = lang2(install("colMeans"), install("SWX.RET&quo...
2015 Dec 11
1
Runtime error when run a RInside program compiled by intel c++ on windows
...intel c++. I included the RInside source files in the project and fixed the compile and link errors. But when run the executable file it prints some error message and quites. I debug into the code.The error messages come from the RInside::initialize() function. It gives following message after Rf_initEmbeddedR(): Warning message: In local(( :bytecode version mismatch: using eval Error in objects(db.pos, all.name = TRUE) : 3 arguments passed to .Internal(ls) which requres 2 And it gives following error after Rf_eval(Rf_lang2(suppressMessagesSymbol,Rf_lang2(requireSymbol, Rf_mk...
2005 Feb 04
5
simple example of C interface to R
i'd like to use the C interface to R in a program i'm writing. as a starting point, i'm trying to create a very simple C program that uses R. i've read the R documentation on this, but i'm having trouble figuring out where SEXP is defined and how to use it. i noticed someone else on this list also tried to use the C interface, but they ran into similar problems: