Re: [R] Colors vector based on group

2012-02-06 Thread Filoche
Thank for your answer. Problem solved. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Colors-vector-based-on-group-tp4361425p4362746.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] Colors vector based on group

2012-02-06 Thread Filoche
Hi there. I should have thought about that myself (/shame). Thank you very much for your time. Phil -- View this message in context: http://r.789695.n4.nabble.com/Colors-vector-based-on-group-tp4361425p4361686.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Colors vector based on group

2012-02-06 Thread Rui Barradas
Hello, > I have a vector like this: > > x = > c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2) > > I would like to associate a colour to each of these entry. For example, I > could use topo.colors(3) (since I have 3 groups). > > I know it is easy to do this with

Re: [R] Colors vector based on group

2012-02-06 Thread Achim Zeileis
On Mon, 6 Feb 2012, Filoche wrote: Hi everyone. I have a vector like this: x = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2) I would like to associate a colour to each of these entry. For example, I could use /topo.colors(3)/ (since I have 3 groups). I know

Re: [R] Colors vector based on group

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 9:40 AM, Filoche wrote: Hi everyone. I have a vector like this: x = c (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2 ) I would like to associate a colour to each of these entry. For example, I could use /topo.colors(3)/ (since I have 3 gr

[R] Colors vector based on group

2012-02-06 Thread Filoche
Hi everyone. I have a vector like this: x = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2) I would like to associate a colour to each of these entry. For example, I could use /topo.colors(3)/ (since I have 3 groups). I know it is easy to do this with /if/else/