Package weave.beans

Examples of weave.beans.RResult


            continue;
          REXP RobjValue = evalScript(rConnection, scriptToAcessRObj, false);
          //When function reference is called returns null
          if (RobjValue == null)
            continue;
          resultVector.add(new RResult(scriptToAcessRObj, rexp2javaObj(RobjValue)))
        }
      }     
    }
   
    //To do find a better way of doing this
View Full Code Here


      evaluateInputScript(rConnection, script, resultVector, showIntermediateResults, showWarnings);
      if (plotScript != "")
      {
        // R Script to EVALUATE plotScript
        String plotEvalValue = plotEvalScript(rConnection,docrootPath, plotScript, showWarnings);
        resultVector.add(new RResult("Plot Results", plotEvalValue));
      }
      for (int i = 0; i < outputNames.length; i++){// R Script to EVALUATE output Script
        String name = outputNames[i];           
        REXP evalValue = evalScript(rConnection, name, showWarnings)
        resultVector.add(new RResult(name, rexp2javaObj(evalValue)));         
      }
      // clear R objects
      evalScript(rConnection, "rm(list=ls())", false);
     
    }
View Full Code Here

        // Script to get R - output
        evalValue = evalScript(rConnection, name, showWarnings);       
//        System.out.println(evalValue);
        if (evalValue.isVector()){
          if (evalValue instanceof REXPString)
            kClusteringResult[i] = new RResult(name, evalValue.asStrings());
          else if (evalValue instanceof REXPInteger)
            kClusteringResult[i] = new RResult(name, evalValue.asIntegers());
          else if (evalValue instanceof REXPDouble){
            if (evalValue.dim() == null)
              kClusteringResult[i] = new RResult(name, evalValue.asDoubles());
            else
              kClusteringResult[i] = new RResult(name, evalValue.asDoubleMatrix());
          }
          else{
            // if no previous cases were true, return debug String
            kClusteringResult[i] = new RResult(name, evalValue.toDebugString());
          }
        }
        else{
          kClusteringResult[i] = new RResult(name, evalValue.toDebugString());
        }
      }
    }
    catch (Exception e)
    {
View Full Code Here

        // Script to get R - output
        evalValue = evalScript(rConnection, name, showWarnings);       
//        System.out.println(evalValue);
        if (evalValue.isVector()){
          if (evalValue instanceof REXPString)
            mdResult[i] = new RResult(name, evalValue.asStrings());
          else if (evalValue instanceof REXPInteger)
            mdResult[i] = new RResult(name, evalValue.asIntegers());
          else if (evalValue instanceof REXPDouble){
            if (evalValue.dim() == null)
              mdResult[i] = new RResult(name, evalValue.asDoubles());
            else
              mdResult[i] = new RResult(name, evalValue.asDoubleMatrix());
          }
          else{
            // if no previous cases were true, return debug String
            mdResult[i] = new RResult(name, evalValue.toDebugString());
          }
        }
        else{
          mdResult[i] = new RResult(name, evalValue.toDebugString());
        }
      }
    }
    catch (Exception e)
    {
View Full Code Here

      {
        assignNamesToVector( inputNames, inputValues, keys, useColumnAsList);
        evaluateInputScript( script, resultVector, showIntermediateResults, showWarnings );
        if (plotScript != ""){// R Script to EVALUATE plotScript
          String plotEvalValue = plotEvalScript(engine,docrootPath, plotScript, showWarnings);
          resultVector.add(new RResult("Plot Results", plotEvalValue));
        }
        for (int i = 0; i < outputNames.length; i++){// R Script to EVALUATE output Script
          String name = outputNames[i];           
          Object evalValue = evalScript(engine, name, showWarnings);         
          resultVector.add(new RResult(name, evalValue));         
        }
        // to clear R objects
        evalScript(engine, "rm(list=ls())", false);
      }
      //Happens when JRI native Library not found - engine will be null
View Full Code Here

            continue;
          Object RobjValue = evalScript(engine, scriptToAcessRObj, false);
          //When function reference is called returns null
          if(RobjValue == null)
            continue;
          resultVector.add(new RResult(scriptToAcessRObj, RobjValue))
        }
      }     
    }
  }
View Full Code Here

      + "\n" + "edges <- data.frame(from=c('a','a','a'), to=c('b','c','d'))"
      + "\n" + "g1 <- graph.data.frame(edges, directed=TRUE, vertices=vertexes)";

//    RResult rresult = new RResult();
//    rresult.setName("test");
    RResult result[];
    try
    {
      result = rService.runScript(null,inputNames, inputValues, outputNames, script, "", false, true,false);
    }
    catch (Exception e)
View Full Code Here

TOP

Related Classes of weave.beans.RResult

Copyright © 2018 www.massapicom. 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.