## 7 Caveat and bugs

You should be warned about some “corners”:

- In some situations, the R interpreter uses the name bound to an object for displaying or for taking some action. For example, if you eval in R the expression:

      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)")

- The conversion between the IEEE values, `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.
- At the present moment, it is not possible to pass Python functions to those R functions which requires callables as arguments, such as `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).

- The interruption from keyboard (Ctrl-C) when RPy is imported in a Python instance running on a console, is completely non-operational. I tried to deal with the `SIGINT` and `SIGBREAK` signals in a similar fashion than with Linux, but I failed. So, the code you run in a console is uninterruptible.
- Running the R event loop in a separate thread doesn’t work. This point, together with the previous one, means that if you want to use a console and you need to make a plot, you must do something like the following:

      >>> 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.

- The Windows version of R always displays the output from the `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.