ipython/ipython — pull request #4017 by gmbecker (2013-08-13 20:02:38+00:00)
Title: Add REPL-like printing of final/return value to %%R cell magic

This change makes the behavior of the %%R cell level magic in the rmagic extension agree with the behavior of both R code in other venues (the R program/RStudio/etc) and with python code within the notebook by treating the code/return value as if it was evaluated within a REPL.p

R's built-in facilities are used to both evaluate the code and determine whether the final value should be printed or not, guaranteeing correct behavior.

This change makes it much more convenient to use R within the notebook framework and also fixes the well-known issue of having to call print when using R's non-base graphics capabilities (ie lattice or ggplot2).

No change is made to the behaviour of the %R line-level magic.

![repl_rmagic](https://f.cloud.github.com/assets/908721/957503/dc793048-0452-11e3-87df-c7e9d3488467.png)