[R] changing values
Antonio Olinto
aolinto at bignet.com.br
Thu Jun 28 16:20:39 CEST 2001
Dear R list members,
I have a factor vector with levels 1, 2, 3 and 4. I want to re-group it: 1 and 2 will be 1 and 3 and 4 will be 2, e.g.:
x <- c(1, 1, 1, 2, 3, 2, 3, 4, ... )
x <- factor(x)
What I have to do create a new vector where 1 1 1 2 3 2 3 4 ... is transformed in 1 1 1 1 2 1 2 2 ... ? (I have more than 200 lines in my dataframe)
Thanks in advance.
Best wishes,
Antônio Olinto
Fisheries Institute
Sao Paulo - BRAZIL
www.institutopesca.sp.gov.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20010628/af302a82/attachment.html
More information about the R-help
mailing list