<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear R list members,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a factor vector with levels 1, 2, 3 and 4.
</FONT><FONT face=Arial size=2>I want to re-group it: 1 and 2 will be 1 and 3
and 4 will be 2, e.g.:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>x <- c(1, 1, 1, 2, 3, 2, 3, 4, ...
)</FONT></DIV>
<DIV><FONT face=Arial size=2>x <- factor(x)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>What I have to do create a new vector where
</FONT><FONT face=Arial size=2>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)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Best wishes,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Antônio Olinto</FONT></DIV>
<DIV><FONT face=Arial size=2>Fisheries Institute</FONT></DIV>
<DIV><FONT face=Arial size=2>Sao Paulo - BRAZIL</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="http://www.institutopesca.sp.gov.br">www.institutopesca.sp.gov.br</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>