Processing.R has released 5 versions. You can get the latest mode from Release Page.
After you download the mode, place it into Processing "modes" directory:
- macOS:
${HOME}/Documents/Processing/modes
- Linux:
${HOME}/sketchbook/modes
- Windows:
C:\Users\<user>\Documents\Processing\modes
Now the features in Processing.R include:
Built-in functions in Processing
The documentation website is https://processing-r.github.io/Processing.R-docs/. This documentation is currently incomplete. Most Processing functions are theoretically supported in Processing.R, but many functions have not been tested and some pages have not been edited yet to reflect differences from other Processing modes.
Libraries in Processing: importLibrary()
Processing.R supports importing standard Processing(Java) libraries that enrich the functionality of Processing. The function importLibrary() imports new libraries manually. This has been tested with one library: peasycam, the "dead-simple mouse-driven camera for Processing."
Before trying the example code below, first install the corresponding library peasycam -- for example using the PDE Contribution Manager > Library.
settings <- function() {
importLibrary("peasycam")
size(200, 200, P3D)
}
setup <- function() {
cam = PeasyCam$new(processing, 100)
cam$setMinimumDistance(50)
cam$setMaximumDistance(500)
}
draw <- function() {
rotateX(-.5)
rotateY(-.5)
background(0)
fill(255, 0, 0)
box(30)
pushMatrix()
translate(0, 0, 20)
fill(0, 0, 255)
box(5)
popMatrix()
}
R Packages: library()
Processing.R has limited support for R packages. It will automatically download R packages that are requested using the library() function, so you can use packages directly.
Here is an example using the foreach package:
library(foreach)
foreach(i=1:3) %do%
print(sqrt(i))
In practice we have only found a few R packages so far that work with Processing.R "out of the box." This is because the package must be pure R and all of its dependencies must also be pure R. There is renjin list of R packages which lists their compatibility with the renjin JVM. Any package fully supported in renjin is theoretically supported in Processing.R.
Limitations in Processing.R
Processing.R is in active development as an experimental pre-release version.
Static sketches: Processing.R does not have a good support for detecting static/active/mix mode. We recommend that all sketches be written in full active mode, defining a separate settings, setup and draw. Even simple sketches should be wrapped in draw(). For example, do not write:
That may cause bugs. Instead, write:
draw <- function() {
line(0, 10, 90, 100)
}
Please try our experimental mode and give us your feedback :) If you want to contribute to this mode, there are issues for new contributors and the architecture documentation.
If you have any problem about the mode, come chat at the Processing.R gitter channel 🎉
Processing.R has released 5 versions. You can get the latest mode from Release Page.
After you download the mode, place it into Processing "modes" directory:
${HOME}/Documents/Processing/modes${HOME}/sketchbook/modesC:\Users\<user>\Documents\Processing\modesNow the features in Processing.R include:
Built-in functions in Processing
The documentation website is https://processing-r.github.io/Processing.R-docs/. This documentation is currently incomplete. Most Processing functions are theoretically supported in Processing.R, but many functions have not been tested and some pages have not been edited yet to reflect differences from other Processing modes.
Libraries in Processing:
importLibrary()Processing.R supports importing standard Processing(Java) libraries that enrich the functionality of Processing. The function
importLibrary()imports new libraries manually. This has been tested with one library: peasycam, the "dead-simple mouse-driven camera for Processing."Before trying the example code below, first install the corresponding library
peasycam-- for example using the PDE Contribution Manager > Library.R Packages:
library()Processing.R has limited support for R packages. It will automatically download R packages that are requested using the
library()function, so you can use packages directly.Here is an example using the
foreachpackage:In practice we have only found a few R packages so far that work with Processing.R "out of the box." This is because the package must be pure R and all of its dependencies must also be pure R. There is renjin list of R packages which lists their compatibility with the renjin JVM. Any package fully supported in renjin is theoretically supported in Processing.R.
Limitations in Processing.R
Processing.R is in active development as an experimental pre-release version.
Static sketches: Processing.R does not have a good support for detecting static/active/mix mode. We recommend that all sketches be written in full active mode, defining a separate
settings,setupanddraw. Even simple sketches should be wrapped indraw(). For example, do not write:That may cause bugs. Instead, write:
Please try our experimental mode and give us your feedback :) If you want to contribute to this mode, there are issues for new contributors and the architecture documentation.
If you have any problem about the mode, come chat at the Processing.R gitter channel 🎉