Permalink
Browse files

Fix Bug 3053

"Newlines lost when routing R console output to the BSL console"
  • Loading branch information...
Valentin Georgiev
Valentin Georgiev committed Feb 8, 2012
1 parent 5690f0c commit 7f7c89c7afc1ac1c7220f25d22c5c4f92719c5e8
@@ -427,8 +427,11 @@ else if (command.contains("quartz"))
RObject data = rservi.evalData("capture.output(print("+command+"))", null); // capture.output(print( )) gives a string output from R, otherwise R objects. The extra pair of () is needed for the R function print to work properly.
RStore rData = data.getData();
StringBuilder builder = new StringBuilder();
for(int i=0;i<rData.getLength();i++) {
int n = rData.getLength();
for(int i=0;i<n;i++) {
builder.append(rData.getChar(i));
if (i+1 < n)
builder.append(NEWLINE);
}
returnVal = builder.toString();
}
@@ -439,7 +442,7 @@ else if (command.contains("quartz"))
error.printStackTrace();
returnVal = "Error: " + error.getMessage();
}
logger.debug(" -> " + returnVal);
logger.debug(" -> "+ NEWLINE + returnVal);
}
return returnVal;
}

0 comments on commit 7f7c89c

Please sign in to comment.