I am using Rcaller with Vaadin framework to make a program for running R-scripts from browser. One feature should be the ability to draw plots. This is not terribly difficult in itself, there are ways to do this with Rcaller. However, as far as I have seen, all of these ways involve saving the resulting plot from R to file system and then displaying it in Java.
This is most inconvenient and uses lot of time and resources. I would like a way to get the plot from R as a stream and direct it to Java, without having to save anything in between.
Is this in any way possible?
I looked up a function "grid.cap()". It takes a snapshot of the currently displayed plot and return the colors as a matrix. These can then be converted into RGB values. Would it be possible to stream these values, instead of the plot itself? This approach has at least one problem, it is really slow. Also, I am very doubtful of what exactly would be returned, as it depends on the state of the display device.