Package org.rosuda.REngine.Rserve

Examples of org.rosuda.REngine.Rserve.RConnection.eval()


            "pvalue <- cdoutput$p.value}";
      }
     
      rConnection.eval(script);
      result.pvalue = rConnection.eval("pvalue").asDouble();
      result.statistic = rConnection.eval("statistic").asDouble();
     
    }
   
    catch (Exception e)
    {
View Full Code Here


      rConnection.assign("x", dataX);
      rConnection.assign("y", dataY);
      rConnection.assign("deg", new int[]{polynomialDegree});

      // Perform the calculation
      rConnection.eval(script);

      // option to draw the plot, regression line and store the image
      /*
      rConnection.assign(".tmp.", docrootPath + rFolderName + "/Linear_Regression.jpg");
      rConnection.eval("jpeg(.tmp.)");
View Full Code Here

      rConnection.eval("abline(fit)");
      rConnection.eval("dev.off()");
       */

      // Get the data from R
      result.coefficients = rConnection.eval("coef").asDoubles();
      result.rSquared = rConnection.eval("rSquared").asDouble();
    }
    catch (Exception e)
    {
      e.printStackTrace();
View Full Code Here

      rConnection.eval("dev.off()");
       */

      // Get the data from R
      result.coefficients = rConnection.eval("coef").asDoubles();
      result.rSquared = rConnection.eval("rSquared").asDouble();
    }
    catch (Exception e)
    {
      e.printStackTrace();
      throw new RemoteException("Unable to run R regression script", e);
View Full Code Here

        }
        double[] value = ListUtils.copyDoubleArray(inputValues[i], new double[inputValues[i].length]);
        rConnection.assign(name, value)
   
      }
      evalValue = rConnection.eval("data.frame(" + names + ")"); // NOT SAFE - script was built using user-specified strings
   
      rConnection.assign("frame",evalValue);
      rConnection.assign("clusternumber", noOfClusters);
      rConnection.assign("iterations",iterationNumber);
View Full Code Here

          rConnection.assign("method", agglomerationMethod[j]);
        }
      }

      // Performing the calculations
      rConnection.eval("dataframe1 <- data.frame(x,y)");
      rConnection.eval("HCluster <- hclust(d = dist(dataframe1), method)");

      // option for drawing the hierarchical tree and storing the image
      rConnection.assign(".tmp.", docrootPath + rFolderName + "/Hierarchical_Clustering.jpg");
      rConnection.eval("jpeg(.tmp.)");
View Full Code Here

        }
      }

      // Performing the calculations
      rConnection.eval("dataframe1 <- data.frame(x,y)");
      rConnection.eval("HCluster <- hclust(d = dist(dataframe1), method)");

      // option for drawing the hierarchical tree and storing the image
      rConnection.assign(".tmp.", docrootPath + rFolderName + "/Hierarchical_Clustering.jpg");
      rConnection.eval("jpeg(.tmp.)");
      rConnection.eval("plot(HCluster, main = \"Hierarchical Clustering\")");
View Full Code Here

      rConnection.eval("dataframe1 <- data.frame(x,y)");
      rConnection.eval("HCluster <- hclust(d = dist(dataframe1), method)");

      // option for drawing the hierarchical tree and storing the image
      rConnection.assign(".tmp.", docrootPath + rFolderName + "/Hierarchical_Clustering.jpg");
      rConnection.eval("jpeg(.tmp.)");
      rConnection.eval("plot(HCluster, main = \"Hierarchical Clustering\")");
      rConnection.eval("dev.off()");

      // Get the data from R
      hclresult.setClusterSequence(rConnection.eval("HCluster$merge").asDoubleMatrix());
View Full Code Here

      rConnection.eval("HCluster <- hclust(d = dist(dataframe1), method)");

      // option for drawing the hierarchical tree and storing the image
      rConnection.assign(".tmp.", docrootPath + rFolderName + "/Hierarchical_Clustering.jpg");
      rConnection.eval("jpeg(.tmp.)");
      rConnection.eval("plot(HCluster, main = \"Hierarchical Clustering\")");
      rConnection.eval("dev.off()");

      // Get the data from R
      hclresult.setClusterSequence(rConnection.eval("HCluster$merge").asDoubleMatrix());
      hclresult.setClusterMethod(rConnection.eval("HCluster$method").asStrings());
View Full Code Here

      // option for drawing the hierarchical tree and storing the image
      rConnection.assign(".tmp.", docrootPath + rFolderName + "/Hierarchical_Clustering.jpg");
      rConnection.eval("jpeg(.tmp.)");
      rConnection.eval("plot(HCluster, main = \"Hierarchical Clustering\")");
      rConnection.eval("dev.off()");

      // Get the data from R
      hclresult.setClusterSequence(rConnection.eval("HCluster$merge").asDoubleMatrix());
      hclresult.setClusterMethod(rConnection.eval("HCluster$method").asStrings());
      // hclresult.setClusterLabels(rConnection.eval("HCluster$labels").asStrings());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.