示例#1
0
 public String getCall() {
   Vector paramCalls = new Vector();
   for (int i = 0; i < params.size(); i++) {
     Param prm = (Param) params.get(i);
     String[] p = prm.getParamCalls();
     for (int j = 0; j < p.length; j++) paramCalls.add(p[j]);
   }
   String call = Deducer.makeRCollection(paramCalls, getName(), false);
   return call;
 }
  protected void saveTotalsAsDataFrame(String saveName) {
    // TODO Implement some basic redundancy avoidance.
    String cmd = "";
    // Save the frequency totals to a temporary variable
    String tempTotals = Deducer.getUniqueName("freqTotals");
    // Deducer.execute(tempTotals + " <- " + tfDialog.getTermFreqCall(this.getExtraTermFreqArgs()));
    cmd += tempTotals + " <- " + tfDialog.getTermFreqCall(this.getExtraTermFreqArgs()) + "\n";
    String totalType = this.tfDialog.getUseDocumentFrequency() ? "doc_freq" : "term_freq";

    // Save the totals
    // Deducer.execute(saveName + " <- d(term=names(" + tempTotals + "), " + totalType + "=" +
    // tempTotals +")");
    cmd +=
        saveName + " <- d(term=names(" + tempTotals + "), " + totalType + "=" + tempTotals + ")\n";
    // delete the temporary variable
    // Deducer.execute("rm(" + tempTotals + ")");
    cmd += "rm(" + tempTotals + ")";
    Deducer.execute(cmd);
  }
示例#3
0
  public static void plot(String call, PlotBuilder.PlotPanel pl) {
    try {
      cont = pl;
      Deducer.timedEval(
          "Sys.setenv(\"JAVAGD_CLASS_NAME\"=\"org/rosuda/deducer/plots/DeviceInterface\")");
      if (pl.devNr == -1) {
        Deducer.timedEval("JavaGD()");
      } else {
        Deducer.timedEval("dev.set(" + (pl.devNr + 1) + ")");
      }

      String cmd = "";
      cmd = call.replace('\n', ' ');
      cmd = cmd.replace('\t', ' ');
      // System.out.println(cmd);
      Deducer.timedEval("print(" + cmd + ")");
      Deducer.timedEval("Sys.setenv(\"JAVAGD_CLASS_NAME\"=\"org/rosuda/JGR/toolkit/JavaGD\")");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 public void executeView() {
   Deducer.execute("print(" + tfDialog.getTermFreqCall(this.getExtraTermFreqArgs()) + ");");
 }