Greetings,
I have installed (from source) the version rpy2 v2.0.0a3 of RPy. My system's
configuration is:

Python 2.6 Python 2.6 (r26:66714, Oct  8 2008, 10:27:48)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 (installed from source)

NumPy 1.20 (also installed from source).

I found that I am unable to run the statement to close a graphics device via
the Python console, via the RPy interface.

For example, when I execute the following R code (drawn from the Example's
section of the RPy v2.0.0a3 documentation)

-----------------------------------------------------------------
m <- matrix(rnorm(100), ncol=5)
pca <- princomp(m)
plot(pca, main="Eigen values")
biplot(pca, main="biplot")
-----------------------------------------------------------------

I found that I was able to generate the plots and was able to close the
graphics device using the command

-----------------------------------------------------------------
dev.off()
-----------------------------------------------------------------
However, when I run the equivalent code via RPy in a Python console,
-----------------------------------------------------------------
import rpy2.robjects as robjects
r = robjects.r
m = r.matrix(r.rnorm(100), ncol=5)
pca = r.princomp(m)
r.plot(pca, main="Eigen values")
r.biplot(pca, main="biplot")
r.dev.off()
-----------------------------------------------------------------
I get the following error message
-----------------------------------------------------------------
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/site-packages/rpy2/robjects/__init__.py",
line 450, in __getattribute__
    return self[attr]
  File "/usr/local/lib/python2.6/site-packages/rpy2/robjects/__init__.py",
line 453, in __getitem__
    res = rinterface.globalEnv.get(item)
LookupError: 'dev' not found
-----------------------------------------------------------------

I am not sure how to solve the above problem, or if it is a bug. Any
pointers/help is appreciated in advance.
Thanks.
Srikanth.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to