search for: rlists

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

Did you mean: lists
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
2017 Oct 27
4
Cannot Compute Box's M (Three Days Trying...)
It can't be this hard, right? I really need a shove in the right direction here. Been spinning wheels for three days. Cannot get past the errors. I'm doing something wrong, obviously, since I can easily compute the Box's M right there in RStudio But I don't see what is wrong below with the coding equivalent. The entire code snippet is below. The code fails below on the call to
2013 Apr 01
2
Timing of SET_VECTOR_ELT
Assume a C program invoked by .Call, that returns a list. Near the top of the program we allocate space for all the list elements. (It is my habit to use "xyz2" for the name of the R object and "xyz" for the pointer to its contents.) PROTECT(means2 = allocVector(REALSXP, nvar)); means = REAL(means2); PROTECT(u2 = allocVector(REALSXP, nvar)); u =
2008 Nov 30
1
Rserve and creating a list of lists
Hello, I have some code which generates lattice objects. The function recieves serialized forms of the lattice objects which 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 =
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)
2007 Feb 16
1
Destination directory creation
Hi people. My first post so be lenient :) I have read stuff on rsync, looked through the options and read the man page but cannot seem to find an answer to my problem. Ok. I have a script which connects to a remote machine via ssh and pulls back a list of source directories/files from a config file on the remote server. I then loop these lines and do an rsync for each item to pull the files
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
Thanks Duncan. Awesome ideas! I think we're getting closer! I tried what you suggested and got a possibly better error... . . . rConnection.assign("boxMVariable", myDf); String resultBV = "str(boxMVariable)"; // your suggestion. RESULTING ERROR: Error in format.default(nam.ob, width = max(ncn), justify = "left") : invalid 'width' argument (No idea
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
I'm not sure what you mean. Could you please be more specific? If I print the string, I get: boxM(boxMVariable[, -5], boxMVariable[, 5]) From this code: . . . // assign the data to a variable.rConnection.assign("boxMVariable", myDf); // create a string command with that variable name.String boxVariable = "boxM(boxMVariable[, -5], boxMVariable[, 5])";
2010 Mar 24
0
Trying to create R dataframe with JRI
Hi all, I am writing here because the JRI mailing list seems abandoned... maybe some of you guys know an answer or has a pointer into the right direction. I am quite confused by the jars that exist between rServe, JRI and rJava. What I want to do is simply using a local R instance from Java and I thought (and still think) JRI is the way forward. I did the following steps: 1) Installed
2017 Oct 28
0
Cannot Compute Box's M (Three Days Trying...)
On 28/10/2017 8:59 AM, Morkus wrote: > 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. The last column in iris is actually a factor. That's stored as an S3-classed integer vector
2017 Oct 29
2
Cannot Compute Box's M (Three Days Trying...)
Thanks Duncan. I can't tell you how helpful all your terrific replies have been. I think the biggest surprise is that nobody appears to be using Java and R together like I"m trying to do. I suppose it should be a surprise since there are no books on the subject and almost no technical documentation other than a few sites here and there. ----- I originally had the "int" as the
2017 Oct 29
0
Cannot Compute Box's M (Three Days Trying...)
On 29/10/2017 7:26 AM, Morkus wrote: > Thanks Duncan. I can't tell you how helpful all your terrific replies > have been. > > I think the biggest surprise is that nobody appears to be using Java and > R together like I"m trying to do. I suppose it should be a surprise > since there are no books on the subject and almost no technical > documentation other than a
2017 Oct 27
0
Cannot Compute Box's M (Three Days Trying...)
Just print the string you are asking to R to evaluate. It doesn't make any sense as an R expression. Fix that, and things will work. Duncan Murdoch On 27/10/2017 3:41 PM, Morkus via R-devel wrote: > It can't be this hard, right? I really need a shove in the right direction here. Been spinning wheels for three days. Cannot get past the errors. > > I'm doing something
2017 Oct 27
0
Cannot Compute Box's M (Three Days Trying...)
Does it work if you supply the closing parenthesis on the call to boxM? The parser says the input is incomplete and a missing closing parenthesis would cause that error.. // create a string command with that variable name.String boxVariable = "boxM(boxMVariable [,-5], boxMVariable[,5]"; // try to execute the command... // FAILS with org.rosuda.REngine.Rserve.RserveException: eval
2017 Oct 28
0
Cannot Compute Box's M (Three Days Trying...)
On 28/10/2017 6:26 AM, Morkus wrote: > I'm not sure what you mean. Could you please be more specific? You were trying to eval an expression that you constructed in Java. I was suggesting that before you eval it, you print it. > > If I print the string, I get: *boxM(boxMVariable[, -5], boxMVariable[, 5])* Right, that's what I was suggesting you do. Now you've fixed the
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...)
On 28/10/2017 7:12 AM, Morkus wrote: > Thanks Duncan. Awesome ideas! > > I think we're getting closer! > > I tried what you suggested and got a possibly better error... > . > . > . > rConnection.assign("boxMVariable", myDf); > > *String resultBV *= *"str(boxMVariable)"*; *// your suggestion.* > > *RESULTING ERROR:* > >
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, ... ),