Hopefully a simple question. I installed "RColorBrewer" as a package.
It works fine in R, but I can't invoke it properly in RPy.

In R, it's invoked as "brewer.xxx", but "r.brewer" is not found 
by python.

It'd be nice if the examples had a library call (I think the faithful
one has two library calls but both are obsolete and are part of stats
now). 

RPy 1.0RC2, R 2.5.0.

Trace below.

JDO

movenpick 328$ python
Python 2.4.4 (#1, May  9 2007, 15:14:53) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
<<< from rpy import *
RHOME= /opt/local/lib/R
RVERSION= 2.5.0
RVER= 2050
RUSER= /Users/jowens
Loading Rpy version 2050 .. Done.
Creating the R object 'r' ..  Done
<<< r.library("RColorBrewer")
['RColorBrewer', 'stats', 'graphics', 'grDevices', 'utils', 'datasets',
'methods', 'base']
<<< palette = r.brewer.pal(3, "Greens")   
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/opt/local/lib/python2.4/site-packages/rpy.py", line 286, in __getattr__
    return self.__getitem__(name)
  File "/opt/local/lib/python2.4/site-packages/rpy.py", line 290, in __getitem__
    obj = self.__dict__[name] = self.__dict__.get(name, self.get(name)) 
rpy.RException: Error in get(x, envir, mode, inherits) : variable "brewer" was
not found

<<< ^D
movenpick 329$ R

R version 2.5.0 (2007-04-23)
Copyright (C) 2007 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

< library("RColorBrewer")
< palette = brewer.pal(3, "Greens")
< palette
[1] "#E5F5E0" "#A1D99B" "#31A354"
< q()
Save workspace image? [y/n/c]: n

[[ Note: I replaced all > with < in the trace so gmane would let
me post. ]]


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to