bwlewis edited this page Sep 13, 2010 · 4 revisions
Clone this wiki locally

This is a very experimental R-language library for Processing. It is deployed as an R package.
It requires that R and Processing are installed on your system, as well as the rJava R package.
The R package “Makevars” script presently assumes a Linux system, but could be (and will be)
adapted for Windows and other systems.

Set the environment variable PROCESSING to your local installation path for the Processing language.
Then install the R package, e.g., with:


In addition to the R package, two example Processing sketches will be installed in your local Processing
sketchbook directory.

Although deployed as an R package, R4P is designed to be run from within Processing. Start processing
and load the “SimpleR4P” or “Boids” sketches.

One may initialize a basic Processing graphics device for R with the “pdev” command.

Generic Processing functions may be accessed from R scripts with the “Process” command.

R functions may be called from Processing via the usual rJava conventions. See the examples for more.

Note that the primitive R console requires that users explicitly “print” or “cat” output to the output window, an
unfortunate side effect from Processing IDE control of stdin/stdout that I have not yet figured out how to get

More documentation, better examples, and other refinements are on their way…