Next: Acknowledgements, Previous: Miscellaneous, Up: Top
You should be warned about some “corners”:
var <- c(1,2,3) plot(var)
you obtain a plot with the y-axis labeled by var
. However, in
Python there is no standard way to know a name bound to an object,
so, even when an Robj
has a Python name, the R interpreter
doesn't see that information. The practical consequence is that the R
plots made from Python are labeled with the entire vector of
data, usually cluttering up the graphic. I really don't see an elegant
way to solve this.
Of course, the immediate and pragmatic solution is to write
r.par(ann=0)
for disabling the automatic label annotations, or to
set the labels explicitly.
Another solution (a bit trickier) is:
>>> r.assign("var", [1,2,3]) >>> r("plot(var)")
NaN
and
Inf
, depends highly on the operating system, since that is what
happens with the Python interpreter (AFAIK). I have no access to a
platform other than Linux, so I may be wrong.
integrate
, for example. It would be necessary to embed the
Python interpreter in R (and only a step forward: an R package
for calling Python :-)
Now, some Windows' specific notes. Most of these are due to my ignorance on the Windows OS; if you have suggestions for solving some of these points, please, contact me (see Contact info and contributing).
SIGINT
and
SIGBREAK
signals in a similar fashion than with Linux, but I
failed. So, the code you run in a console is uninterruptible.
>>> r.plot(data) >>> while 'windows' in r_events(): ... pass
Then, the loop is unbreakable with Ctrl-C. The only way to stop it is to close the graphic window.
help
command in a separate window. This window must be refreshed
by the R event loop. But, now, the problem is that the device of that
window doesn't appear listed on the return value of r_events
; so,
there is no way to make a loop like the previous one.
Suggestion for Windows users: the problems listed before
only occur when Python runs on a console (a MS-DOS
window). I strongly suggest that, for interactive sessions, you use the
IDLE shell instead. With IDLE, the keyboard
interruption works as expected and the graphics and help windows are
completely functional without the need to use the r_events
function.