public String prettyPrint() throws StatisticsException {

    StringBuilder s = new StringBuilder();

    // use the REXP worker result
    try {
      if (!this.worker.isNull()) {
        LOG.info("We have content back from R");

        if (this.worker.inherits("try-error") || this.worker.isString()) {
          throw new StatisticsException(new REXPMismatchException(this.worker,
              "Try-Error from R \n" + this.worker.toString()));
          } else if (this.worker.isList()) {
          RList resultL = this.worker.asList();
          RList r1 = null;

          for (int ridx = 0; ridx < resultL.size(); ridx++) {
            // last result in list is JSON
            LOG.debug("ridx = {}", ridx);
            r1 = resultL.at(ridx).asList();

            String[] keys = r1.keys();
            for (int kidx = 0; kidx < keys.length; kidx++) {
              LOG.debug("keys[" + kidx + "] {}", keys[kidx]);
              s.append(parseResults(keys[kidx], r1));
            }
          }
        }
      } else {
        // worker is null, we did not get any results back from R
        throw new StatisticsException(new REXPMismatchException(this.worker,
            "No Result returned from R \n" + this.worker.toDebugString()));
      }
    } catch (REXPMismatchException e) {
      throw new StatisticsException("Error Parsing all Results", e);
    }

    LOG.info(s.toString());
    return s.toString();
  }