[R] ask a question about data replacement

song song
Fri, 29 Jan 2010 07:17:17 -0000

the question like this :

 x=c(2,6,8,11,11,11,6,8,2,8,6,11,8,2,6,11)

x contains values (2, 6, 8, 11) with frequency (3, 4, 4, 5).

now I want to get the vector by replacing  (2, 6, 8, 11) --->>> (1 2 3
4)

that is, want to get new x as (1 2 3 4 4 4 2 3 1 3 2 4 3 1 2 4)


is there any function in R do this?

Thank you!!

	[[alternative HTML version deleted]]