Show More
@@ -188,13 +188,13 b' class RMagics(Magics):' | |||
|
188 | 188 | Returns the output to R's stdout() connection, and |
|
189 | 189 | the value generated by evaluating the code (see below) |
|
190 | 190 | |
|
191 |
In line mode (ie called with %R <stuff>), |
|
|
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). | |
|
195 | 195 | |
|
196 | 196 | In cell mode (called with %%R ...), behavior |
|
197 |
|
|
|
197 | reproduces the REPL behavior of the R | |
|
198 | 198 | interpreter (which agrees with how cells of |
|
199 | 199 | python code are handled by the notebook). |
|
200 | 200 | |
@@ -204,8 +204,8 b' class RMagics(Magics):' | |||
|
204 | 204 | invisibly, the value will be printed using the |
|
205 | 205 | show R function. |
|
206 | 206 | |
|
207 |
Actual evaluation of R code is done via a |
|
|
208 | of the form withVisible({<code>}) | |
|
207 | Actual evaluation of R code is done via an R | |
|
208 | call of the form withVisible({<code>}) | |
|
209 | 209 | |
|
210 | 210 | ''' |
|
211 | 211 | old_writeconsole = ri.get_writeconsole() |
@@ -436,13 +436,14 b' class RMagics(Magics):' | |||
|
436 | 436 | In [9]: %R X=c(1,4,5,7); sd(X); mean(X) |
|
437 | 437 | Out[9]: array([ 4.25]) |
|
438 | 438 | |
|
439 |
As a cell, this will run a block of R code |
|
|
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. | |
|
440 | 442 | |
|
441 | 443 | In [10]: %%R |
|
442 | 444 | ....: Y = c(2,4,3,9) |
|
443 |
....: |
|
|
444 | ....: | |
|
445 | ||
|
445 | ....: summary(lm(Y~X)) | |
|
446 | ||
|
446 | 447 | Call: |
|
447 | 448 | lm(formula = Y ~ X) |
|
448 | 449 |
General Comments 0
You need to be logged in to leave comments.
Login now