Package org.rosuda.REngine.Rserve

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


    RConnection rConnection = null;
    double[][] result;
    try
    {
      rConnection = getRConnection();
      rConnection.assign("data", getREXP(data));
     
      String script = "normalized <- t(as.matrix(sapply(data, function(x) {(x - min(x, na.rm=TRUE))/(max(x, na.rm=TRUE)- min(x, na.rm=TRUE))})))";
     
      rConnection.eval(script);
     
View Full Code Here


    {
      rConnection = getRConnection();
     
      String script = "";
     
      rConnection.assign("x", dataX);
      rConnection.assign("y", dataY);
      if(flag)
      {
        script = "obj <- try(t.test(x, y, var.equal = TRUE, na.rm = TRUE), silent=TRUE)\n" +
            "if(is(obj, \"try-error\")) { statistic <- 0 \n  pvalue <- 0} else { cdoutput <- obj\n" +
View Full Code Here

      rConnection = getRConnection();
     
      String script = "";
     
      rConnection.assign("x", dataX);
      rConnection.assign("y", dataY);
      if(flag)
      {
        script = "obj <- try(t.test(x, y, var.equal = TRUE, na.rm = TRUE), silent=TRUE)\n" +
            "if(is(obj, \"try-error\")) { statistic <- 0 \n  pvalue <- 0} else { cdoutput <- obj\n" +
            "statistic <- cdoutput$statistic\n" +
View Full Code Here

        + "rSquared <- summary(fit)$r.squared\n",
        equation
      );
     
      // Push the data to R
      rConnection.assign("x", dataX);
      rConnection.assign("y", dataY);
      rConnection.assign("deg", new int[]{polynomialDegree});

      // Perform the calculation
      rConnection.eval(script);
View Full Code Here

        equation
      );
     
      // Push the data to R
      rConnection.assign("x", dataX);
      rConnection.assign("y", dataY);
      rConnection.assign("deg", new int[]{polynomialDegree});

      // Perform the calculation
      rConnection.eval(script);
View Full Code Here

      );
     
      // Push the data to R
      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
View Full Code Here

      noOfClusters[0] = numberOfClusters;
     
      int[]iterationNumber = new int[1];
      iterationNumber[0] = iterations;
     
      rConnection.assign("clusternumber", noOfClusters);
     
      //storing column length
      int columnLength = inputValues[0].length;
     
      //to check if columns are not empty and if all columns are of the same length
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("data.frame(" + names + ")"); // NOT SAFE - script was built using user-specified strings
   
      rConnection.assign("frame",evalValue);
View Full Code Here

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

     
      //String script = "Clus <- kmeans(frame, "+numberOfClusters+","+iterations+")";
View Full Code Here

   
      }
      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+")";
     
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.