search for: rlist

Displaying 20 results from an estimated 64 matches for "rlist".

Did you mean: list
2001 Sep 10
1
not safe to return vector pointer
Hello All, I recently upgraded from R-1.1.1 to R-1.2.2. I have an R function that uses .Call() to return a list from C code. The C code has the form: SEXP function(SEXP var) { SEXP rlist ; PROTECT(rlist = NEW_LIST(3)) ; VECTOR_PTR(rlist)[0] = NEW_INTEGER(1) ; VECTOR_PTR(rlist)[1] = NEW_STRING(1) ; ... UNPROTECT(1) ; return(rlist) ; } When I try to .Call("function",...) from R I get the following error message: Error: not safe to return vector po...
2017 Oct 27
4
Cannot Compute Box's M (Three Days Trying...)
...t;6.5,3,5.2,2,virginica\n" + "6.2,3.4,5.4,2.3,virginica\n" + "5.9,3,5.1,1.8,virginica\n"; List tableRead = rConnection.eval( "read.csv(textConnection(\"" + inputIris + "\"), header = FALSE)").asList(); // works! double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); String[] d5 = ((REXPVector) ((RList) tableRead).get(4)).asS...
2013 Apr 01
2
Timing of SET_VECTOR_ELT
...R object and "xyz" for the pointer to its contents.) PROTECT(means2 = allocVector(REALSXP, nvar)); means = REAL(means2); PROTECT(u2 = allocVector(REALSXP, nvar)); u = REAL(u2); PROTECT(loglik2 = allocVector(REALSXP, 2)); loglik = REAL(loglik2); PROTECT(rlist = mknamed(VECSXP, outnames)); Can I assign the individual elements into rlist using SET_VECTOR_ELT at this point, or do I need to wait until the end of the program, after I've filled in means[i], u[i], etc.? I likely depends on whether I'm assigning a pointer or a copy. Terry T.
2008 Nov 30
1
Rserve and creating a list of lists
...it then unserializes and then adds to an ArrayList<REXP>. REXPRaw rser = new REXPRaw( target ); //target contains the raw serialized forms of lattice objects rconn.assign("temp",rser); REXP ret = rconn.eval("invisible(unserialize(temp))"); (1) rexpArr.add(ret); RList rlist = new RList(rexpArr); REXPList rl = new REXPList(rlist); The problem is when I do an assign rconn.assign("finalresult",rl); whence I get *** REXPFactory unable to interpret org.rosuda.REngine.REXPUnknown@1629ce8c[4] * ** REXPFactory unable to interpret org.rosuda.REngin...
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
Hey Duncan, Hard to debug? That's an understatement. Eyes bleeding.... In any case, I tried all your suggestions. To get "integer" for the final column, I had to change the code to get integers instead of strings. double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); int[] d5 = ((REXPVector) ((RList) tableRead).get(4)).asInte...
2007 Feb 16
1
Destination directory creation
...the script im just pulling out important bits) :- RSYNC_BIN=$(/usr/bin/which rsync) # May want to drop the v verbose RSYNC_OPTS=" -Pvprtlz --delete --delete-excluded --copy-unsafe-links --numeric-ids" RSYNC="${RSYNC_BIN} ${RSYNC_OPTS}" # Ok here is the Rsync loop for RLIST in ${remote_get_list} do # Going to put a safety test here in case / is file list if [ "${RLIST}" = "/" ];then echo "\n[Remote_Get for ${remote_get_host}]\n\tWARNING:We dont want / as a source. Too intense so s...
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
...documentation shows in biotools: Examples data(iris) boxM(iris[, -5], iris[, 5]) ------- Now, in the debugger, the built values of myDf are these: myDf = {org.rosuda.REngine.REXPGenericVector at 562} "org.rosuda.REngine.REXPGenericVector at 17d99928+[5]? ? payload = {org.rosuda.REngine.RList at 566} size = 5 ? 0 = {org.rosuda.REngine.REXPDouble at 570} "org.rosuda.REngine.REXPDouble at 6fffcba5[150]" ? 1 = {org.rosuda.REngine.REXPDouble at 571} "org.rosuda.REngine.REXPDouble at 34340fab[150]? ? 2 = {org.rosuda.REngine.REXPDouble at 572} "org.rosuda.REngine.REXPDoubl...
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
...t; "6.2,3.4,5.4,2.3,virginica\n" + >> "5.9,3,5.1,1.8,virginica\n"; >> List tableRead = rConnection.eval( >> "read.csv(textConnection("" + inputIris + ""), header = FALSE)").asList(); // works! >> double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); >> double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); >> double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); >> double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); >> String[] d5 = ((REXPVec...
2010 Mar 24
0
Trying to create R dataframe with JRI
.../lib contains jri.dll, JRI.jar and R.dll) and wrote an simple test application that simply calls a command and does not do much parameter assignment (except strings and simple integers) -- all worked fine. Now I want to feed data as a dataframe to R. I thought I can make RVector objects, create RList objects from that and create REXP dataframes from those lists. I found an example here: http://code.google.com/p/jamsim/source/browse/trunk/JAMSIM/src/org/jamsim/r/RInterfaceHL.java?spec=svn52&r=52 ... RList rlist = new RList(vectors.size(), true); ... // turn the rlist into a dataframe REXP...
2017 Oct 28
0
Cannot Compute Box's M (Three Days Trying...)
...red as an S3-classed integer vector with an attribute listing the levels. Using strings instead can cause problems in a few R functions (they want factors, and don't do automatic conversions), but the errors you're seeing seem more fundamental. > > double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); > double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); > double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); > double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); > *int**[] d5 = ((REXPVector) ((RList) ta...
2017 Oct 29
2
Cannot Compute Box's M (Three Days Trying...)
...d integer vector with an attribute listing the levels. Using >> strings instead can cause problems in a few R functions (they want >> factors, and don't do automatic conversions), but the errors you're >> seeing seem more fundamental. >> double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); >> double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); >> double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); >> double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); >> int*[] d5 = ((REXPVecto...
2017 Oct 29
0
Cannot Compute Box's M (Three Days Trying...)
...with an attribute listing the levels. Using >> strings instead can cause problems in a few R functions (they want >> factors, and don't do automatic conversions), but the errors you're >> seeing seem more fundamental. >> double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); >> double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); >> double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); >> double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); >> /int/*[...
2017 Oct 27
0
Cannot Compute Box's M (Three Days Trying...)
...gt; "6.2,3.4,5.4,2.3,virginica\n" + > "5.9,3,5.1,1.8,virginica\n"; > > List tableRead = rConnection.eval( > "read.csv(textConnection(\"" + inputIris + "\"), header = FALSE)").asList(); // works! > > double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); > double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); > double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); > double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); > String[] d5 = ((REXPVector) ((RList) ta...
2017 Oct 27
0
Cannot Compute Box's M (Three Days Trying...)
..."6.2,3.4,5.4,2.3,virginica\n" + > "5.9,3,5.1,1.8,virginica\n"; > > List tableRead = rConnection.eval( > "read.csv(textConnection(\"" + inputIris + "\"), header = > FALSE)").asList(); // works! > > double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); > double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); > double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); > double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); > String[] d5 = ((REXPVector) ((RList) ta...
2017 Oct 28
0
Cannot Compute Box's M (Three Days Trying...)
...inica\n" + >> "5.9,3,5.1,1.8,virginica\n"; >> List tableRead = rConnection.eval( >> "read.csv(textConnection("" + inputIris + ""), header = >> FALSE)").asList(); // works! >> double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); >> double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); >> double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles(); >> double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles(); >> String[...
2017 Oct 26
1
How to create a table structure in Java code?
Thanks! I just figured it out (thanks to "Beyond Compare") and was coming here to post back. The boxM test doesn't work with that (now, finally working) REXP structure, but I probably now need to create a table or something and parse that structure. So much fun! :) Thanks again. - M Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email. > --------
2017 Oct 28
0
Cannot Compute Box's M (Three Days Trying...)
...; *boxM(iris[, -5], iris[, 5])* > > *-------* > ** > Now, in the debugger, the built values of myDf are these: > > *myDf* = {org.rosuda.REngine.REXPGenericVector at 562} > "org.rosuda.REngine.*REXPGenericVector*@17d99928+[5]? > > ? payload = {org.rosuda.REngine.*RList*@566} size = 5 > ? 0 = {org.rosuda.REngine.REXPDouble at 570} > "org.rosuda.REngine.*REXPDouble*@6fffcba5[150]" > ? 1 = {org.rosuda.REngine.REXPDouble at 571} > "org.rosuda.REngine.*REXPDouble*@34340fab[150]? > ? 2 = {org.rosuda.REngine.REXPDouble at 572} > &quot...
2010 Feb 10
2
Total least squares linear regression
Dear all, After a thorough research, I still find myself unable to find a function that does linear regression of 2 vectors of data using the "total least squares", also called "orthogonal regression" (see : http://en.wikipedia.org/wiki/Total_least_squares) instead of the "ordinary least squares" method. Indeed, the "lm" function has a
2006 Feb 21
6
How to sum values across multiple variables using a wildcard?
I have a dataframe called "data" with 5 records (in rows) each of which has been scored on each of many variables (in columns). Five of the variables are named var1, var2, var3, var4, var5 using headers. The other variables are named using other conventions. I can create a new variable called var6 with the value 15 for each record with this code: > var6=var1+var2+var3+var4+var5
2007 Dec 05
4
Java parser for R data file?
Hi everyone, Has anyone written a parser in Java for either the ASCII or binary format produced by save()? I need to parse a single large 2D array that is structured like this: list( "32609_1" = c(-9549.39231289146, -9574.07159324482, ... ), "32610_2" = c(-6369.12526971635, -6403.99620977124, ... ), "32618_2" = c(-2138.29095689061, -2057.9229403233, ... ),