<div dir="ltr">Senhores, bom dia.<div><br></div><div>Preciso de uma ajuda, onde tenho dois arquivos de texto ou xls, tanto faz.</div><div>Inventei este exemplo:</div><div><br></div><div><div>v1 <- seq(1,50,by=1) </div><div>
v2 <- seq(1,100,by=2)</div><div>tab1 <- cbind(v1,v2)</div><div><br></div><div><br></div><div>C1 <- seq(1,100,by=1)</div><div>C2 <- seq(1,100,by=1)</div><div>dados <- seq(11,60,by=1)</div><div>tab2 <- cbind(C1,C2,dados)</div>
</div><div><br></div><div>Verão que tab1 possui 50 linhas e tab2 100 linhas<br></div><div><br></div><div>Preciso:</div><div>1. comparar e filtrar as colunas onde v1  = C1 e v2 = C2  </div><div>2. Gerar uma terceira com C1 e C2 e os dados</div>
<div><br></div><div>O resultado do exemplo acima seria</div><table border="0" cellpadding="0" cellspacing="0" width="192" style="border-collapse:collapse;width:144pt">
 <colgroup><col width="64" span="3" style="width:48pt">
 </colgroup><tbody><tr height="17" style="height:12.75pt">
  <td height="17" class="" width="64" style="height:12.75pt;width:48pt">"C1"</td>
  <td class="" width="64" style="border-left-style:none;width:48pt">"C2"</td>
  <td class="" width="64" style="border-left-style:none;width:48pt">"dados"</td>
 </tr>
 <tr height="17" style="height:12.75pt">
  <td height="17" class="" width="64" style="height:12.75pt;width:48pt">1</td>
  <td class="" width="64" style="border-left-style:none;width:48pt">1</td>
  <td class="" width="64" style="border-left-style:none;width:48pt">11</td>
 </tr></tbody></table><br>em SQL seria <div><br></div><div><div>SELECT tab1.["v1"], tab1.["v2"], tab2.["dados"]</div><div>FROM tab2 INNER JOIN tab1 ON (tab2.["C2"] = tab1.["v2"]) AND (tab2.["C1"] = tab1.["v1"]);</div>
</div><div><br></div><div>Tem como passar para o R?</div><div><br></div><div>Agradeço desde já</div><div><div><br></div>-- <br>Hélio Gallo Rocha<br>IFSULDEMINAS - Câmpus Muzambinho<br>
</div></div>