* * * *
The integration of R into online web services is (for me) one of the more exciting prospects in R’s future. That is way I was very excited coming across Jamie Love’s recent creation: R-Node.
What is R-Node
R-Node is a (open source) web front-end to R (the statistical analysis package).
Using this front-end, you can from any web browser connect to an R instance running on a remote (or local) server, and interact with it, sending commands and receiving the responses. In particular, graphing commands such as plot() and hist() will execute in the browser, drawing the graph as an SVG image.
You can see a live demonstration of this interface by visiting:
And using the following user/password login info:
(This link was originally posted here)
Here are some screenshots:
In the second screenshot you see the results of the R command ‘plot(x, y)’ (with the reimplementation of plot doing the actual plotting), and in the fourth screenshot you see a similar plot command along with a subsequent best fit line (data points calculated with ‘lowess()’) drawn in.
Once in, you can try out R by typing something like:
x <- rnorm(100) plot(x, main="Random numbers") l <- lowess(x) lines (l$y)
The plot and lines commands will bring up a graph - you can escape out of it, download the graph as a SVG file, and change the graph type (e.g. do: plot (x, type="o") ).
Many R commands will work, though only the hist(), plot() and lines() work for graphing.
Please don't type the R command q() - it will quit the server, stopping it working for everyone! Also, as everyone shares the same session for now, using more unique variable name than 'x' and 'l' will help you.
Currently there is only limited error checking but the code continues to be improved and developed. You can download it from:
How do you may imagine yourself using something like this? Feel invited to share with me and everyone else in the comments.
Here are some of the more technical details of R-Node:
How does R-Node works
(Credit: The following text is based on this forum thread)
Besides Protovis, R-node also uses jquery and ExtJS core on the front-end.
The server side is R+Rserve, and to connect the browser client to the R server Jamie used a nodejs based application server.
Projects utilised in this include:
- Protovis - http://vis.stanford.edu/protovis/
- Nodejs - http://nodejs.org/
- R - http://www.r-project.org/
- Rserve - http://www.rforge.net/Rserve/doc.html
- Shjs - http://shjs.sourceforge.net/
I would love to read your thoughts about this in the comments.