One possible way:
x = (('carni', 'red'), ('na', 'orange'))
r = ro.StrVector([elt[1] for elt in x])
r.names = ro.StrVector([elt[0] for elt in x])

L.

On 24/04/10 03:46, John Owens wrote:
> I haven't been able to work out how to map this syntax from R:
>
> colours<- c(carni = "red", "NA" = "orange", insecti = "yellow",
>               herbi = "green", omni = "blue")
>
> to rpy. (This example is from p. 107 in the ggplot2 book.)
>
> Suggestions appreciated!
>
> JDO
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to