<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Prezados,</p>
    <p>Tendo criar mais uma coluna em data.<br>
    </p>
    <p>data$Var2 <-
ifelse(grepl("BARREIRO|CENTRO-SUL|LESTE|NORDESTE|NOROESTE|NORTE|OESTE|PAMPULHA|VENDA
      NOVA|RMBH|MG|SEM INFORMACAO", data$Var1, ignore.case = TRUE),<br>
          
gsub(".*(BARREIRO|CENTRO-SUL|LESTE|NORDESTE|NOROESTE|NORTE|OESTE|PAMPULHA|VENDA
      NOVA|RMBH|MG|SEM INFORMACAO).*", "\\1",data$Var1), "OUTRO ESTADO")<br>
    </p>
    <p><br>
    </p>
    <p>NOROESTE acaba sendo excluído de Var2, sendo substituído por
      OESTE. Não quero que isso aconteça. Penso seja por conta do
      "OESTE" nele contido, já que existe outra palavra OESTE. O
      restante está exatamente como eu quero. Abaixo, exemplo de como
      está ficando. Desde já agradeço.<br>
    </p>
    <p><br>
    </p>
    <p> </p>
    <table cellspacing="0" border="0">
      <colgroup width="286"></colgroup> <colgroup width="128"></colgroup>
      <colgroup width="154"></colgroup> <tbody>
        <tr>
          <td valign="bottom" height="18" align="center"><b><font
                color="#000000">Var1</font></b></td>
          <td valign="bottom" align="center"><b><font color="#000000">Freq</font></b></td>
          <td valign="bottom" align="center"><b><font color="#000000">Var2</font></b></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">SEM INFORMACAO</font></td>
          <td valign="bottom" align="right"><font color="#000000">0,38</font></td>
          <td valign="bottom" align="left"><font color="#000000">SEM
              INFORMACAO</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">SEM INFORMACAO</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">SEM
              INFORMACAO</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">BARREIRO</font></td>
          <td valign="bottom" align="right"><font color="#000000">9</font></td>
          <td valign="bottom" align="left"><font color="#000000">BARREIRO</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">CENTRO-SUL</font></td>
          <td valign="bottom" align="right"><font color="#000000">22,18</font></td>
          <td valign="bottom" align="left"><font color="#000000">CENTRO-SUL</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">CIDADE DE CANDEIAS/MG</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">MG</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">CIDADE DE CORONEL FABRICIANO/MG</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">MG</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">CIDADE DE ITABIRA/MG</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">MG</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">CIDADE DE ITABIRITO/MG</font></td>
          <td valign="bottom" align="right"><font color="#000000">0,13</font></td>
          <td valign="bottom" align="left"><font color="#000000">MG</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">GOVERNADOR VALADARES/MG</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">MG</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">LESTE</font></td>
          <td valign="bottom" align="right"><font color="#000000">5,83</font></td>
          <td valign="bottom" align="left"><font color="#000000">LESTE</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">NORDESTE</font></td>
          <td valign="bottom" align="right"><font color="#000000">9,25</font></td>
          <td valign="bottom" align="left"><font color="#000000">NORDESTE</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">NOROESTE</font></td>
          <td valign="bottom" align="right"><font color="#000000">13,05</font></td>
          <td valign="bottom" align="left"><font color="#000000">OESTE</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">NORTE</font></td>
          <td valign="bottom" align="right"><font color="#000000">8,11</font></td>
          <td valign="bottom" align="left"><font color="#000000">NORTE</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">OESTE</font></td>
          <td valign="bottom" align="right"><font color="#000000">7,48</font></td>
          <td valign="bottom" align="left"><font color="#000000">OESTE</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">PAMPULHA</font></td>
          <td valign="bottom" align="right"><font color="#000000">8,87</font></td>
          <td valign="bottom" align="left"><font color="#000000">PAMPULHA</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">RMBH/BETIM</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">RMBH</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">RMBH/BRUMADINHO</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">RMBH</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">RMBH/CONTAGEM</font></td>
          <td valign="bottom" align="right"><font color="#000000">1,01</font></td>
          <td valign="bottom" align="left"><font color="#000000">RMBH</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">RMBH/ESMERALDAS</font></td>
          <td valign="bottom" align="right"><font color="#000000">0</font></td>
          <td valign="bottom" align="left"><font color="#000000">RMBH</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">SEM INFORMACAO</font></td>
          <td valign="bottom" align="right"><font color="#000000">0,89</font></td>
          <td valign="bottom" align="left"><font color="#000000">SEM
              INFORMACAO</font></td>
        </tr>
        <tr>
          <td valign="bottom" height="20" align="left"><font
              color="#000000">VENDA NOVA</font></td>
          <td valign="bottom" align="right"><font color="#000000">13,31</font></td>
          <td valign="bottom" align="left"><font color="#000000">VENDA
              NOVA</font></td>
        </tr>
      </tbody>
    </table>
    <p>
      <style type="text/css">
                body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small }
                a.comment-indicator:hover + comment { background:#ffd; position:absolute; display:block; border:1px solid black; padding:0.5em;  } 
                a.comment-indicator { background:red; display:inline-block; border:1px solid black; width:0.5em; height:0.5em;  } 
                comment { display:none;  } 
        </style></p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
  </body>
</html>