<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Humberto, bom dia!</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Segue uma uma sugestão, sem considerar que possa haver duplicidade...</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default"><font face="monospace, monospace">### <code r></font></div><div class="gmail_default" style=""><div class="gmail_default"><font face="monospace, monospace">df <- read.table(text=</font></div><div class="gmail_default"><font face="monospace, monospace">"dia<span class="" style="white-space:pre"> </span>mes<span class="" style="white-space:pre">       </span>ano<span class="" style="white-space:pre">       </span>boat<span class="" style="white-space:pre">      </span></font></div><div class="gmail_default"><font face="monospace, monospace">9<span class="" style="white-space:pre">   </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>AGIOS.NIKOLAUS<span class="" style="white-space:pre">    </span></font></div><div class="gmail_default"><font face="monospace, monospace">10<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>AGIOS.NIKOLAUS<span class="" style="white-space:pre">    </span></font></div><div class="gmail_default"><font face="monospace, monospace">11<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>AGIOS.NIKOLAUS<span class="" style="white-space:pre">    </span></font></div><div class="gmail_default"><font face="monospace, monospace">12<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>AGIOS.NIKOLAUS<span class="" style="white-space:pre">    </span></font></div><div class="gmail_default"><font face="monospace, monospace">13<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>AGIOS.NIKOLAUS</font></div><div class="gmail_default"><font face="monospace, monospace">9<span class="" style="white-space:pre">     </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>X<span class="" style="white-space:pre"> </span></font></div><div class="gmail_default"><font face="monospace, monospace">10<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>X<span class="" style="white-space:pre"> </span></font></div><div class="gmail_default"><font face="monospace, monospace">11<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>X<span class="" style="white-space:pre"> </span></font></div><div class="gmail_default"><font face="monospace, monospace">12<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>Y<span class="" style="white-space:pre"> </span></font></div><div class="gmail_default"><font face="monospace, monospace">13<span class="" style="white-space:pre">  </span>1<span class="" style="white-space:pre"> </span>2005<span class="" style="white-space:pre">      </span>Y", head=T, <a href="http://as.is">as.is</a>=T)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">df$lance <- NA</font></div><div class="gmail_default"><font face="monospace, monospace">df</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">for (boat in unique(df$boat)) {</font></div><div class="gmail_default"><font face="monospace, monospace">     sel <- which(df$boat==boat)</font></div><div class="gmail_default"><font face="monospace, monospace">     df[sel, "lance"] <- 1:length(sel)</font></div><div class="gmail_default"><font face="monospace, monospace">}</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">df</font></div><div class="gmail_default"><font face="monospace, monospace">#    dia mes  ano           boat lance</font></div><div class="gmail_default"><font face="monospace, monospace"># 1    9   1 2005 AGIOS.NIKOLAUS     1</font></div><div class="gmail_default"><font face="monospace, monospace"># 2   10   1 2005 AGIOS.NIKOLAUS     2</font></div><div class="gmail_default"><font face="monospace, monospace"># 3   11   1 2005 AGIOS.NIKOLAUS     3</font></div><div class="gmail_default"><font face="monospace, monospace"># 4   12   1 2005 AGIOS.NIKOLAUS     4</font></div><div class="gmail_default"><font face="monospace, monospace"># 5   13   1 2005 AGIOS.NIKOLAUS     5</font></div><div class="gmail_default"><font face="monospace, monospace"># 6    9   1 2005              X     1</font></div><div class="gmail_default"><font face="monospace, monospace"># 7   10   1 2005              X     2</font></div><div class="gmail_default"><font face="monospace, monospace"># 8   11   1 2005              X     3</font></div><div class="gmail_default"><font face="monospace, monospace"># 9   12   1 2005              Y     1</font></div><div class="gmail_default"><font face="monospace, monospace"># 10  13   1 2005              Y     2</font></div><div class="gmail_default"><font face="monospace, monospace">### </code></font></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="arial, helvetica, sans-serif" style="font-size:small"><div style="font-family:'trebuchet ms',sans-serif;display:inline">​</div></font><font face="arial, helvetica, sans-serif" style="font-size:12.8px"><span style="font-size:small">================================================</span><br>Éder Comunello</font><div style="font-size:12.8px"><span style="font-family:arial,helvetica,sans-serif">Agronomist (UEM), MSc in Environ. Sciences (UEM)</span><font face="arial, helvetica, sans-serif"><br></font></div><div style="font-size:12.8px"><div style="font-size:small"><span style="font-family:arial,helvetica,sans-serif">DSc in Agricultural Systems Engineering (USP/Esalq)</span><br></div><div><span style="font-size:small">Brazilian Agricultural Research Corporation (</span><font face="arial, helvetica, sans-serif" style="font-size:small">Embrapa)</font></div><div><div><font face="arial, helvetica, sans-serif" style="font-size:small">Dourados, MS, Brazil </font><font face="arial, helvetica, sans-serif" size="2">|<O>|</font></div><div style="font-size:small"><span style="font-family:arial,helvetica,sans-serif">================================================</span><br></div></div></div><div style="font-size:small"><font face="arial, helvetica, sans-serif">GEO, </font>-22.2752, -54.8182, 408m<span style="font-family:arial,helvetica,sans-serif"><br></span></div><div style="font-size:12.8px"><span style="font-size:small;font-family:arial,helvetica,sans-serif">UTC-04:00 / DST: UTC-03:00</span></div><div><div><div><br></div><div><br></div></div><div style="font-size:small"><br></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">Em 11 de maio de 2016 09:37, Humberto Hazin <span dir="ltr"><<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="PT-BR" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal">Olá pessoal,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Estou precisando criar uma coluna chamada lances. Onde cada lance corresponde a um dia, mês, ano e barco conforme o exemplo abaixo:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><table border="0" cellspacing="0" cellpadding="0" width="327" style="width:245.0pt;border-collapse:collapse"><tbody><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">           dia<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">mes<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">ano<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">boat<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">9<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">10<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">11<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">12<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">13<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td></tr></tbody></table><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Eu gostaria que a tabela ficasse dessa forma aqui <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><table border="0" cellspacing="0" cellpadding="0" width="391" style="width:293.0pt;border-collapse:collapse"><tbody><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">dia<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">mes<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">ano<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">boat<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">Lance<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">9<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">10<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">11<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">3<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">12<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">4<u></u><u></u></span></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">13<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">1<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">2005<u></u><u></u></span></p></td><td width="135" nowrap valign="bottom" style="width:101.0pt;background:yellow;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal"><span style="color:black">AGIOS.NIKOLAUS<u></u><u></u></span></p></td><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:15.0pt"><p class="MsoNormal" align="right" style="text-align:right"><span style="color:black">5<u></u><u></u></span></p></td></tr></tbody></table><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Agradeço desde já<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="HOEnZb"><font color="#888888"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Humberto<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></font></span></div></div><br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br></div>