Description Usage Arguments Details Value Examples
Functions load, run and manipulate a processing PApplet via R.
1 2 3 4 5 |
name |
character string. Name of the PApplet class to run. |
loc |
integer vector of size two.
x and y coordinate for opening the RApplet (defaults to |
title |
character string. Title for the window used by the PApplet. |
path |
character string. Path and name of the jar file that contains the PApplet. |
PApp |
object of class PApplet as returned by |
x,y |
integer. New size for the PApplet. |
setter |
character string. Name of the set method in the PApplet. |
... |
Argument list for the set method. |
Before using a processing (see http://processing.org) program, called a
PApplet you have to create a jar file by using File/Export Application
in the processing programming environment. Then you have to
add the jar using PAddJar()
. Now you can start the
processing application called a PApplet via R using PApplet()
.
Now you can transfer data
with PSet()
to the PApplet using a set methods that you
implemented in the applet.
PApplet()
returns an PApplet
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## example with external jar
PAddJar(system.file("examples","Cube3D.jar", package="rProcessing"))
app1 <- PApplet("Cube3D")
## use the built-in example PScatter
app2 <- PScatter(sample(1:500, 20), sample(1:500, 20))
## to close the PApplets you can use
#PClose(app1)
#PClose(app2)
#see how PScatter works
PScatter
#you can find the processing source code file on your disk at
system.file("examples", "PScatter.pde", package="rProcessing")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.