The latest release of Processing.R may be installed:
- Into the Processing Development Environment (PDE) via the Contributions Manager: PDE > Add Tool > Modes > Processing.R.
- By downloading the latest release. This may be used stand-alone or installed into PDE by adding to the Processing Libraries folder and restarting PDE. The mode will appear in the PDE Modes list once installed.
- By compiling / building from source
The following instructions cover compiling Processing.R from source. It may be built in several ways:
- a PDE mode, which can be
- added to the PDE
- built with its own PDE
- a command-line runner -- does not require the PDE
- a docker container image -- DEPRECATED
Warning: Many parts of PDE integration are still incomplete: files cannot be double-clicked or dragged to open so code must be cut-pasted into the window, saved files cannot be reopened except through the recent files dialog list, the run button launches multiple window rather than re-running, stop button does not work, etc.
Building Processing.R from source requires ant.
- checkout Processing.R from github
- configure
./scripts/generate-ant-file.sh
- build and install mode into PDE using
ant build
- start PDE and select
R Language
from mode drop-down menu
Configure ./scripts/generate-ant-file.sh
:
modes
: the destination for installing the mode once it is built.- MacOSX:
/Users/[MyUserName]/Documents/Processing/modes/
- Windows:
%homepath%\Documents\Processing\modes\
- Linux:
${HOME}/sketchbook/modes/
- MacOSX:
core
andpde
: paths to core library and pde.jar. They are be used to build runner and run test cases.- MacOSX:
/Applications/Processing.app/Contents/Java/core/library
and/Applications/Processing.app/Contents/Java/pde.jar
- Linux:
[MyPDE]/core/library
and[MyPDE]/lib/pde.jar
- MacOSX:
executable
: optional argument giving the location of the PDE.- The path is used in
ant run
to start a PDE instance. Leave blank to not launch PDE onant run
. - MacOSX:
/Applications/Processing.app/Contents/MacOS/Processing
- Linux:
[MyPDE]/processing
- The path is used in
For example, to install the mode into a default existing PDE app on a MacOS system, set arguments in ./scripts/generate-ant-file.sh
such as:
modes="/Users/[MyUserName]/Documents/Processing/modes"
core="/Applications/Processing.app/Contents/Java/core/library"
pde="/Applications/Processing.app/Contents/Java/pde.jar"
executable="/Applications/Processing.app/Contents/MacOS/Processing"
This will generate build.xml errors (as the core and pde directories only contain the actual jars, not source). However it will work correctly.
Build the source code of Processing core and pde wherever it is located on the system. For example:
$ cd processing/core
$ ant build
$ cd processing/app
$ ant build
Then set the two paths accordingly in ./scripts/generate-ant-file.sh
:
modes="${HOME}/Documents/Processing/modes"
core="../processing/core/library/"
pde="../processing/app/pde.jar"
executable="/Applications/Processing.app/Contents/MacOS/Processing"
- Run
./scripts/generate-ant-file.sh
- this will generate a valid build.xml
- Run
ant install
- the mode will be installed into PDE
Processing.R offers a runner which allows users to execute .rpde scripts directly from the command line without requiring the PDE app.
To build the runner:
- Run
ant try
This will create a jar file RLangMode.jar
in try/
To use the runner:
- Run
java -jar ./try/RLangMode.jar <your R script>
- The script should be a valid .rpde file.
posAX <- 11
posAY <- 22
posBX <- 33
posBY <- 22
line(posAX, posAY, posBX, posBY)
The output is:
NOTICE: The docker image of Processing.R is currently deprecated, since graphic card is not fully supported in Docker. 3D sketches couldn't work in the docker container.
Docker containers provide a lightweight virtual environment that package up Linux applications with everything that they need to run.
In order to install a docker image and then launch a docker container of Processing.R running in a virtual Linux desktop environment:
- install docker on your system
docker pull quay.io/gaocegege/processing.r
docker run quay.io/gaocegege/processing.r
- open the link of NoVNC
http://<IP of the container>:6901/vnc_auto.html?password=process
in a web browser. - play with Processing.R in a desktop environment :)
See the video in vimeo: