[IPython-dev] use of InteractiveShell and R magic

Jonathan Taylor jonathan.taylor@stanford....
Thu Jun 14 17:23:34 CDT 2012


I'm trying to run some cells through InteractiveShell and am getting an
unexpected error message which is that my shell
can't find the %R line magic:


In [1]: import IPython.frontend.terminal.interactiveshell as IS

In [2]: shell = IS.InteractiveShell()

In [3]: shell.run_cell('%load_ext rmagic')

In [4]: shell.run_cell('%R X=rnorm(20)')
ERROR: Line magic function `%R` not found.
In [5]:

In [5]: load_ext rmagic

In [6]: %R X=rnorm(20)
Out[6]:
array([ 0.08724969,  2.03344439, -0.82111458, -2.07136391, -0.11913743,
        0.19598438,  0.58574042, -0.33684877, -0.9659225 , -0.68404775,
       -0.0278716 ,  1.34169008, -0.6034878 ,  1.76146422, -0.19225874,
       -1.15088263, -1.10644146, -1.27298014, -1.18212805,  1.60194601])

Is this expected? I can't tell.



-- 
Jonathan Taylor
Dept. of Statistics
Sequoia Hall, 137
390 Serra Mall
Stanford, CA 94305
Tel:   650.723.9230
Fax:   650.725.8977
Web: http://www-stat.stanford.edu/~jtaylo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20120614/a10bc333/attachment.html 


More information about the IPython-dev mailing list