The Art of R Programming

(WallPaper) #1
First, we usedr.assign()to copy a variable from Python’s namespace
to R’s. We then ranexpand.grid()(with a period in the name instead of an
underscore, since we are running in R’s namespace), assigning the result to
g. Again, the latter is in R’s namespace. Note that the call towireframe()did
not automatically display the plot, so we needed to callplot().
The official documentation for RPy is athttp://rpy.sourceforge.net/rpy/doc/
rpy.pdf. Also, you can find a useful presentation, “RPy—R from Python,” at
http://www.daimi.au.dk/~besen/TBiB2007/lecture-notes/rpy.html.

332 Chapter 15

Free download pdf