Package org.rosuda.REngine.Rserve

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


      }
      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);

     
      //String script = "Clus <- kmeans(frame, "+numberOfClusters+","+iterations+")";
     
//    String clusteringScript = "Clustering <- function(dframe, clusternumber, iterations)\n" +
View Full Code Here


      agglomerationMethod[5] = "median";
      agglomerationMethod[6] = "mcquitty";
      String agglomerationMethodType = new String("ward");
     
      // Push the data to R
      rConnection.assign("x", dataX);
      rConnection.assign("y", dataY);

      // checking for user method match
      for (int j = 0; j < agglomerationMethod.length; j++)
      {
View Full Code Here

      agglomerationMethod[6] = "mcquitty";
      String agglomerationMethodType = new String("ward");
     
      // Push the data to R
      rConnection.assign("x", dataX);
      rConnection.assign("y", dataY);

      // checking for user method match
      for (int j = 0; j < agglomerationMethod.length; j++)
      {
        if (agglomerationMethod[j].equals(agglomerationMethodType))
View Full Code Here

      // checking for user method match
      for (int j = 0; j < agglomerationMethod.length; j++)
      {
        if (agglomerationMethod[j].equals(agglomerationMethodType))
        {
          rConnection.assign("method", agglomerationMethod[j]);
        }
      }

      // Performing the calculations
      rConnection.eval("dataframe1 <- data.frame(x,y)");
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\")");
      rConnection.eval("dev.off()");

      // Get the data from R
View Full Code Here

          names = names + "," + name;}
        else{
          names = name;
        }
        double[] value = ListUtils.copyDoubleArray(inputValues[i], new double[inputValues[i].length]);
        rConnection.assign(name, value)
      }
     
      evalValue = rConnection.eval("Bind <- cbind(" + names + ")"); // NOT SAFE - bindingInput was built with string concat using user-specified strings
     
      //Built in script
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.