[R] a replacement problem

Yong Wang wang at galton.uchicago.edu
Sat Mar 13 02:37:18 CET 2004


hi,all
a quick question:  

a vector

v<-c(g,r,y,g,y,y,r)

needs to be

v<-c(1,2,3,1,3,3,2)

i.e., replace g,r,y as 1,2,3

how to do that, by the way, what key words I should use to search for such 
basic operation command?
thank you 

best




More information about the R-help mailing list