Skip to content

Commit

Permalink
Output commands and results to the console
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Feb 1, 2011
1 parent 09ea9ce commit 3134831
Showing 1 changed file with 13 additions and 3 deletions.
Expand Up @@ -13,18 +13,28 @@
import org.rosuda.JRI.Rengine;

public class RConsoleView extends ScriptingConsoleView {
private Rengine re;

private Rengine re;

public RConsoleView() {
re = new Rengine(new String[] {"--vanilla"}, false, null);
re = new Rengine(new String[] {"--vanilla"}, false, null);
}

@Override
protected String executeCommand( String command ) {
return re.eval(command).toString();
echoCommand(command);
System.out.println("R cmd: " + command);
String returnVal = re.eval(command).toString();
System.out.println(" -> " + returnVal);
printMessage(returnVal);
return returnVal;
}

protected void waitUntilCommandFinished() {
// Don't know if there's a way to sensibly implement this method for R.
}

private void echoCommand(final String command) {
printMessage(NEWLINE + "> " + command + NEWLINE);
}
}

0 comments on commit 3134831

Please sign in to comment.