@@ -188,13 +188,13 @@ def eval(self, line, line_mode):
188188 Returns the output to R's stdout() connection, and
189189 the value generated by evaluating the code (see below)
190190
191- In line mode (ie called with %R <stuff>), behavior
192- is unchanged, returns a python object representing
193- the final value, suitable for assignment into a
194- python variable .
191+ In line mode (ie called with %R <stuff>), resulting
192+ values are not printed (explicit calls to the
193+ show/print R functions still result in properly
194+ captured R output) .
195195
196196 In cell mode (called with %%R ...), behavior
197- now reproduces the REPL behavior of the R
197+ reproduces the REPL behavior of the R
198198 interpreter (which agrees with how cells of
199199 python code are handled by the notebook).
200200
@@ -204,8 +204,8 @@ def eval(self, line, line_mode):
204204 invisibly, the value will be printed using the
205205 show R function.
206206
207- Actual evaluation of R code is done via a call
208- of the form withVisible({<code>})
207+ Actual evaluation of R code is done via an R
208+ call of the form withVisible({<code>})
209209
210210 '''
211211 old_writeconsole = ri .get_writeconsole ()
@@ -436,13 +436,14 @@ def R(self, line, cell=None, local_ns=None):
436436 In [9]: %R X=c(1,4,5,7); sd(X); mean(X)
437437 Out[9]: array([ 4.25])
438438
439- As a cell, this will run a block of R code, without bringing anything back by default::
439+ As a cell, this will run a block of R code. By default the resulting value
440+ is printed if it would be when evaluating the same code within an R REPL.
441+ Nothing is returned to python by default.
440442
441443 In [10]: %%R
442444 ....: Y = c(2,4,3,9)
443- ....: print(summary(lm(Y~X)))
444- ....:
445-
445+ ....: summary(lm(Y~X))
446+
446447 Call:
447448 lm(formula = Y ~ X)
448449
0 commit comments