GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Installing RPy |
For sophisticated plotting using the R package see Chapter 72.
Install python-rpy.
Older approaches did:
$ wajig install rpy_0.3.1-1_i386.deb $ (cd /usr/lib; sudo ln -s R/bin/libR.so) |
$ python Python 2.3.1 (#2, Sep 24 2003, 11:39:14) [GCC 3.3.2 20030908 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from rpy import * >>> l = [r.dchisq(x, 4) for x in r.seq(0, 10, by=0.1)] >>> r.par(ask=1, ann=0) {'ask': 0, 'ann': 1} >>> r.plot(l, type='lines') Hit <Return> to see next plot: >>> r.dev_off() {'null device': 1} >>> ^D |
$ cd /tmp $ wget http://easynews.dl.sourceforge.net/sourceforge/rpy/rpy-0.2.tar.gz $ tar zxvf rpy-0.2.tar.gz $ cd rpy-0.2 $ sudo python setup.py install $ sudo emacs -nw /etc/ld.so.conf Add the line: /usr/lib/R/bin $ sudo ldconfig $ python Python 2.2.1 (#2, Sep 7 2002, 15:35:22) [GCC 2.95.4 20011002 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from rpy import * >>> l = [r.dchisq(x, 4) for x in r.seq(0, 10, by=0.1)] >>> r.par(ask=1, ann=0) >>> r.plot(l, type='lines') >>> ^D $ cd .. $ sudo rm -rf rpy-0.2* |
For earlier versions of rpy I used to get:
$ python >>> from rpy imprt * Traceback (most recent call last): File "<stdin>", line 1, in ? File "rpy.py", line 24, in ? import _rpy ImportError: /usr/lib/atlas/libblas.so.2: undefined symbol: e_wsfe >>> |
$ wajig remove atlas2-base |
However, more recently this packages is actually required to run R and rpy!
With version 0.3.1 of rpy I get the following (11 Aug 03):
$ python2.2 Python 2.2.3+ (#1, Aug 10 2003, 10:11:23) [GCC 3.3.1 (Debian)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import rpy Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.2/site-packages/rpy.py", line 24, in ? import _rpy ImportError: /usr/lib/python2.2/site-packages/_rpymodule.so: undefined symbol: jump_now >>> |
Also happens for python2.3 (11 Aug 2003).