Displaying 20 results from an estimated 3000 matches similar to: "Import R-output into Java"
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])";
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)
2017 Oct 26
3
How to create a table structure in Java code?
That's amazing! Thank you!!!
One follow up question, if that's OK?
If, instead of using hard-coded CSV, I read the CSV into a variable first, then it fails again with a parse error.
Code below.
So, if I read the CSV into a variable, do I need an additional wrapper method?
Seems like it should still work.
Thanks in advance for your reply.
-M
String inputIris =
2017 Oct 25
2
How to create a table structure in Java code?
Hi all,
Using RConsole, it's easy to get data from the database that you can use in an R Command. Like this:
(Reference case)
irisQuery <- dbGetQuery(conn, "select * from iris")
boxM(irisQuery [,-5], irisQuery[,5])
----
(Actual case this posting is about)
Yet, if I'm getting that same (sample IRIS) data, say, in a web service possibly POSTED from a SQL command, that same
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 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
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.
> --------
2005 Aug 22
1
Fetching Warning Messages
Hi,
I am facing one problem of fetching R warning messages in Java Code
using Rserve. It is easier to trap R Error messages by using catching
RSrvException. I came to know one way of fetching R Warning messages, i.e.
using "withCallingHandlers", below is my Java Program, which uses
withCallingHandlers of R :
import org.rosuda.JRclient.*;
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 =
2009 Aug 03
1
RServe - How to use 'createReference' method?
I need to input a txt, or xls, file from a client to R, using RServe.
>From what I've been reading, the best way to do this, is using the
'createReference' method, from REngine package.
But I couldn't find any documents exemplifying it's use. I got to upload a
file from java? And then? How do i refeer the file to this method?
Best Regards,
J. Daniel
--
View this message
2010 Aug 20
1
Rserve (Anyone?)
REXP has an asBytes() method. Will this capture the output of an R plot
function if a proper graphics device is used? It appears R insists on
sending plot output to a file. Kind of strange since it insists on loading
all your data into memory before it can do anything.
If so then does anyone know what this would be? I prefer png or jpeg.
Example:
c is an RConnection
REXP r =
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:*
>
>
2009 Mar 13
0
ctree from Java via Rserve
Hi,
I want to run the R-function ctree (package party) from Java over Rserve
with the following Java-Code:
try{
RConnection v = new RConnection();
v.voidEval("library(party)");
v.voidEval("try(load(\"C:\\Documents and Settings\\daten2.rda\"))");
v.voidEval("try(pdf(\"C:\\Documents and Settings\\test4.pdf\"))");
v.voidEval("plot
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
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
2
How to do a "Box's M" Test with
Trying to get past a frustrating error to do a "simple" Box's M test using Java.
The Box's M test says it will work with a data.frame.
Here's the setup code:
REXP myDf = REXP.createDataFrame(new RList(
new REXP[]
{
new REXPDouble(d1),
new REXPDouble(d2),
new REXPDouble(d3),
new REXPDouble(d4),
new REXPInteger(d5)
}));
Here's the call:
REXP boxMResult =
2006 Sep 05
1
Reserve and biobase
Hi
I am using Rserve for R2.3.1.
every time after I load Biobase library, a new Graphics window frame pops up. Could any onw know how can avoid it.
Best
Saeede
class testReserve {
public static void main(String[] args) {
RServeConnection rsCon = null;
Rconnection c = null;
Process proc = null;
try {
Runtime rt = Runtime.getRuntime();
proc
2009 Mar 11
1
RServe
Dear all,
I'm trying to use R-functions from Java. I want to use the Package Rserve.
Everthing is installed and I can run my Java-testprogramm.
...
Rconnection r = new Rconnection();
double[] d = r.eval("rnorm(10)").asDoubleArray();
...
But now I get always arrays with ten "0.0", which is not correct
I suppose, that is is a problem from R, because at the fist time (last
2010 Aug 17
1
DetachedEval Issues
Hello everyone,
I have been attempting to make use of the newly implemented detachedEval functionality and I am having a few teething issues.
My code works fine when tested with both the Client and the Server on a single machine, but issues arise when I run them separately.Possibly because the local / local connection is running voer a Unix socket rather than tcp proper?
Rsession*