similar to: setting the seed in standalone code using Rlib

Displaying 20 results from an estimated 200 matches similar to: "setting the seed in standalone code using Rlib"

2006 Apr 13
1
bus error on calling nmmin
Hi, I'm trying to get a toy program making use of nmmin to run successfully. I've gotten to the point of compiling. However, when I attempt to run my executable, I guess a bus error. I see that someone else has asked about using nmmin before <http://tolstoy.newcastle.edu.au/R/help/06/03/23944.html>, but I haven't come across any replies. Is there some documentation on how to
2008 Aug 04
2
Parsing code with newlines
Dear List, When I try to parse code containing newline characters with R_ParseVector, I get a compilation error. How can I compile code that includes comments and newlines? I am using the following: void* my_compile(char *code) { SEXP cmdSexp, cmdExpr = R_NilValue; ParseStatus status; PROTECT (cmdSexp = allocVector (STRSXP, 1)); SET_STRING_ELT (cmdSexp, 0, mkChar (code));
1997 Nov 24
0
R-alpha: random number generator -- S-plus's
--Multipart_Mon_Nov_24_14:51:09_1997-1 Content-Type: text/plain; charset=US-ASCII >>>>> "PaulG" == Paul Gilbert <pgilbert@bank-banque-canada.ca> writes: MM> The code is basically in V&R 1 and 2; V&R2 on p.167. I have it as a MM> C function that I used to dyn.load into S-plus in order MM> to prove that S-plus was using it.
2008 Jul 18
0
Rcpp from C++
Hi Sri, I haven't really elaborated on it having other stuff to prepare first, but as far as I got you first assign data to a vector: #include <R.h> #include <Rinternals.h> #undef R_INTERFACE_PTRS #include <Rembedded.h> #include "Rcpp.hpp" #include <R_ext/Parse.h> #include <Rinternals.h> #include <Rdefines.h> //assigning a vector SEXP
2013 Oct 16
1
Parallel R expression evaluations
Hi all, I am using R-3.0.1 under Linux platform to embed R into my C++ code. I am facing an error while executing more than 1 R-expressions parallelly. I am executing round(X) and abs(X) parallelly on a set of 50 input rows which resulted in segmentation fault after getting the following errors. Error: unprotect_ptr: pointer not found Error: argument to 'findVar' is not an environment
2009 Jan 08
1
Callbacks seems to get GCed.
Dear list, I am trying to implement a publish-subscribe mechanism in for an embedded R interpreter. But somehow my registered closures seem to get collected by the GC, even though I have protected them. I have reducted my code to the following sample. Sorry if it is a little verbose. The first couple of call of calls still work, but at some point one of the callbacks (callback1 in my
2012 Feb 01
3
Crash in R using embedded.
Hi, I'm new to R, and am trying to embed R into another application. I'm calling gev.fit() from the ismev package, and it is crashing somewhere inside it. gdb is not catching it, and valgrind is not showing any memory corruption issues. I suspect it's memory corruption, because it doesn't crash in exactly the same spot each time. I'm running R 2.12.2 on a 64 bit linux (Ubuntu
2009 Sep 03
1
Running an expression 1MN times using embedded R
Hello, I'm evaluating this expression expression({ for(x in 1:5){ .Call('rh_status','x') }}) a million times from a program with R embedded in it. I have attached reproducible code that crashes with Program received signal SIGSEGV, Segmentation fault. 0x00002b499ca40a6e in R_gc_internal (size_needed=0) at memory.c:1309 1309 FORWARD_NODE(R_PPStack[i]); Current language:
2011 Nov 03
2
Take variables in data.frame and create list of matrices
Hi, I have this sample data below and would like to create a list of matricies. setseed(1254) id <- c(1,1,1,1 ,2,2,2) o <- as.factor(c(1:4, 1, 3, 4)) r <- rep(.5, 7) v <- rnorm(7) s <- rnorm(7) dat <-data.frame(id, o, r, v, s) dat #> dat # id o r v s # 1 1 0.5 0.7024631 2.0813672 # 1 2 0.5 -0.5541955 0.1095156 # 1 3 0.5 -1.0418167 0.4164930 # 1
1999 Jan 01
0
RE: timeslab
On 01-Jan-99 Prof Brian Ripley wrote: > -rw-rw---- 1 root sysadmin 188267 Jan 1 06:20 > timeslab-1.0-1.tar.gz > -rw-rw-r-- 1 root sysadmin 180290 Jan 1 02:02 > timeslab-1.0.tar.gz > > So which is which, what's the difference? .... Sorry if this wasn't self evident: timeslab-1.0.tar.gz == timeslab-1.0-0.tar.gz and thus
1997 Sep 15
0
R-alpha: set.seed(.) [was 'compatibility']
>>>>> Thomas Lumley writes: >> Two compatibility issues found while trying to convert a simulation >> from S to R. >> 1. set.seed() We don't have this function. According to Venables & >> Ripley it just picks a seed from a list of 1000 possibilities. How about >> >> "set.seed" <-function (i)
2007 Sep 23
0
initial scrambling of seed in do_setseed / RNG_Init
I would like to suggest a modification of initial scrambling of the seed in RNG_Init (called from do_setseed). The modified code is equivalent, but faster. Patch against R-devel_2007-09-22 follows --- R-devel-orig/src/main/RNG.c 2007-09-02 07:49:35.000000000 +0200 +++ R-devel-modif/src/main/RNG.c 2007-09-23 10:51:59.234566440 +0200 @@ -216,8 +216,8 @@ BM_norm_keep = 0.0; /* zap Box-Muller
2008 May 24
1
value returned by findFun when the name cannot be found.
Dear list, I have been using "findVar" (defined in src/main/envir.c) happily and would like to use "findFun". However I have trouble when the name searched cannot be found: while "findVar" returns R_UnboundValue, "findFun" does not (the 4 last lines of "findFun" are copied below). error(_("could not find function
2007 Jul 04
2
problem with findFun call from embedded R
I was debugging a problem reported to me regarding PL/R, and found that I can duplicate it using only R sources. It might be characterized as possibly a misuse of the findFun() function, but I leave that for the R devel experts to decide. The below results are all with R-2.5.1 (I can't seem to download r-patched at the moment, but didn't see anything in the 2.5.1-patched release
2011 Mar 27
0
setseed() works well
I tried the following comm in Linux(Ubuntu), It works well: >set.seed(43);runif(3):rnorm(3) >set.seed(43);runif(3);rnorm(3) At 2011-03-26 19:00:05£¬r-sig-debian-request@r-project.org wrote: >Send R-SIG-Debian mailing list submissions to > r-sig-debian@r-project.org > >To subscribe or unsubscribe via the World Wide Web, visit >
2004 Oct 08
2
R-2.0.0 findVar and findFun question
Dear all, when working on a project with embedded R, I found out that R-2.0.0 causes a problem where older versions worked OK. Rf_findVar(...) causes the following error when used to find a generic function (such as print): fun = Rf_findVar(...); R_tryEval(fun, ...); Error in function (object, ...) : Invalid generic function in usemethod Alternatively, using Rf_findFun(...) seems OK in this
2008 Sep 03
8
suggestion of new API function for embedded programming.
While doing some embedded programming and trying to figure out how to generate a hand coded SEXP equivalent of the line "t.test(x,conf.level=(1-p))$conf.int[2]" I had an idea for an addition to the embedded API. There are a number of hidden or static parse functions (R_ParseBuffer, R_Parse1Buffer, etc.) which take an IoBuffer* and returns a parsed tree. If one or more of these
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 = R_NilValue; PROTECT(e =
2012 Jul 05
2
skipped correlation
hello,Everyone! I am a freshman to use R. Can anybody tell me where has scor function which achieves the skipped correlation? Thank you very much! Bset wishes! Jiaolong Qin [[alternative HTML version deleted]]
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