Re: [Rpy] How to use libraries in rpy?

2007-05-13 Thread Gregory R. Warnes

The problem is that in python '.' (period) is a valid character in a  
variable/function *name*, while it is not valid in python.  To  
overcome this problem, use '_' (underscore), which RPy will translate  
to a '.'

So, try

palette = r.brewer_pal(3, "Greens")

-Greg

On May 12, 2007, at 3:22 PM, John Owens wrote:

> John Owens  yahoo.com> writes:
>
> + >>> palette = r.brewer.pal(3, "Greens")
> + Traceback (most recent call last):
> +   File "", 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
>
> This does work, though, not sure why the original did not:
>
> palette = r('brewer.pal(3,"Greens")')
>
> JDO
>
>
>
> -- 
> ---
> 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


-
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


Re: [Rpy] How to use libraries in rpy?

2007-05-13 Thread Gregory Warnes
Sorry, there was a typo in my message:

On May 13, 2007, at 10:05PM , Gregory R. Warnes wrote:

>
> The problem is that in **R** '.' (period) is a valid character in a
> variable/function *name*, while it is not valid in python.  To
> overcome this problem, use '_' (underscore), which RPy will translate
> to a '.'
>
> So, try
>
>   palette = r.brewer_pal(3, "Greens")
>
> -Greg
>
> On May 12, 2007, at 3:22 PM, John Owens wrote:
>
>> John Owens  yahoo.com> writes:
>>
>> + >>> palette = r.brewer.pal(3, "Greens")
>> + Traceback (most recent call last):
>> +   File "", 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
>>
>> This does work, though, not sure why the original did not:
>>
>> palette = r('brewer.pal(3,"Greens")')
>>
>> JDO
>>
>>
>>
>> - 
>> -
>> ---
>> 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
>
>
> -- 
> ---
> 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


-
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