void de.alysis.r.consoleout.R_Test.testConnect  ) 
 

Test basic connection to localhost.

00054                                   {
00055                 try {
00056                         REXP x = c.eval("R.version.string");
00057                         System.out.println(x.toString());
00058                         //double[] d = c.eval("rnorm(100)").asDoubleArray();
00059                         double[] dataX, dataY;
00060                         dataX = new double[] { 1, 2, 3 };
00061                         dataY = new double[] { 1, 2, 3 };
00062                         c.assign("x", dataX);
00063                         c.assign("y", dataY);
00064                         //RList l = c.eval("lowess(x,y)").asList();
00065                         //double[] lx = (double[]) l.at("x").getContent();
00066                         //double[] ly = (double[]) l.at("y").getContent();
00067                         c.voidEval("m <- lm(x~y)");
00068                         double[] coeff = (double[]) c.eval("coefficients(m)").getContent();
00069                         for (int i = 0; i < coeff.length; i++) {
00070                                 System.out.println(coeff[i]);
00071                         }
00072                 } catch (Exception e) {
00073                         e.printStackTrace();
00074                         fail();
00075                 }
00076         }


Generated on Mon Jun 26 18:45:59 2006 for RSubmit by  doxygen 1.4.6