<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Humberto, boa tarde!</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 ideia. Fornecer dados sempre ajuda muito...</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style=""><div class="gmail_default"><font face="monospace, monospace">### <code r></font></div><div class="gmail_default"><font face="monospace, monospace">rm(list=ls())</font></div><div class="gmail_default"><font face="monospace, monospace">setwd("D:/LAB/NOVOS")</font></div><div class="gmail_default"><font face="monospace, monospace">dir(patt="csv$")</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">df0 <- read.csv2("dt.mapas.csv") </font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">dup <- which(duplicated(df0)); length(dup) # 132</font></div><div class="gmail_default"><font face="monospace, monospace">df <- df0[-dup,] # dados sem duplicatas</font></div><div class="gmail_default"><font face="monospace, monospace">df$lance <- NA; head(df)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace"># tabulação cruzada</font></div><div class="gmail_default"><font face="monospace, monospace">tab <- addmargins(table(df$boat, df$ano), 2, FUN=sum); tab</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"> for (ano in unique(df$ano[sel])) {</font></div><div class="gmail_default"><font face="monospace, monospace"> sel2 <- which(df$boat==boat & df$ano==ano)</font></div><div class="gmail_default"><font face="monospace, monospace"> ord <- with(df[sel2,], order(ano, mes, dia))</font></div><div class="gmail_default"><font face="monospace, monospace"> df[sel2[ord], "lance"] <- 1:length(sel2)</font></div><div class="gmail_default"><font face="monospace, monospace"> }</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"># para ajudar na conferência... comparar com tab</font></div><div class="gmail_default"><font face="monospace, monospace">tmp <- aggregate(lance~ano+boat, data=df, FUN=max); tmp</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">write.csv2(df, "boat.txt") ### verificar o arquivo no diretório de trabalho!</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 19 de maio de 2016 12:05, 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="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Boa tarde Eder,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Mais uma vez agradeço pela disposição. Segue o link dos dados via dropbox<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a href="https://www.dropbox.com/s/zulr5a9m44sv2s4/dt.mapas.csv?dl=0" target="_blank">https://www.dropbox.com/s/zulr5a9m44sv2s4/dt.mapas.csv?dl=0</a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Humberto<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a> [mailto:<a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a>] <b>Em nome de </b>Éder Comunello<br><b>Enviada em:</b> quinta-feira, 19 de maio de 2016 08:28</span></p><div><div class="h5"><br><b>Para:</b> Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>><br><b>Cc:</b> <a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a><br><b>Assunto:</b> Re: [R-br] Criar uma coluna de lancamentos de pesca<u></u><u></u></div></div><p></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Humberto, bom dia!<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Nesse caso você precisaria fornecer teus dados ou uma amostra deles. Selecione uma amostra dos teus dados e verifique se o problema se repete com eles. Se a amostra for pequena, pode colar a saída do comando dput(seudataframe) diretamente no corpo do email. <u></u><u></u></span></p></div><div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><div><div><div><div><div><div><div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif"></span><span style="font-family:"Trebuchet MS",sans-serif"><u></u><u></u></span></p></div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif"><br>Éder Comunello</span><u></u><u></u></p><div><p class="MsoNormal"><span style="font-size:9.5pt;font-family:"Arial",sans-serif">Agronomist (UEM), MSc in Environ. Sciences (UEM)</span><span style="font-size:9.5pt"><u></u><u></u></span></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">DSc in Agricultural Systems Engineering (USP/Esalq)</span><u></u><u></u></p></div><div><p class="MsoNormal">Brazilian Agricultural Research Corporation (<span style="font-family:"Arial",sans-serif">Embrapa)</span><span style="font-size:9.5pt"><u></u><u></u></span></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Dourados, MS, Brazil </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif">|<O>|</span><span style="font-size:9.5pt"><u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><u></u><u></u></p></div></div></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">GEO, </span>-22.2752, -54.8182, 408m<u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">UTC-04:00 / DST: UTC-03:00</span><span style="font-size:9.5pt"><u></u><u></u></span></p></div><div><div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Em 18 de maio de 2016 15:09, Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>> escreveu:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Ola Eder,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Obrigado pela dica realmente tinha 132 linhas repetidas. Entretanto, apareceu outro problema. Ele so esta fazendo para o primeiro barco apenas e não para os demais. Tens alguma ideia do que seja? No teu script com os dados que vc criou roda perfeitamente.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Humberto</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a> [mailto:<a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a>] <b>Em nome de </b>Éder Comunello<br><b>Enviada em:</b> quinta-feira, 12 de maio de 2016 17:12</span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>Para:</b> Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>><br><b>Cc:</b> <a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a><br><b>Assunto:</b> Re: [R-br] Criar uma coluna de lancamentos de pesca<u></u><u></u></p></div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Humberto,</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">É provável que seja uma linha (ou mais) em duplicidade para os 4 campos: boat, ano, mes e dia.</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">?duplicated</span><u></u><u></u></p></div></div><div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><div><div><div><div><div><div><div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif"></span><u></u><u></u></p></div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif"><br>Éder Comunello</span><u></u><u></u></p><div><p class="MsoNormal"><span style="font-size:9.5pt;font-family:"Arial",sans-serif">Agronomist (UEM), MSc in Environ. Sciences (UEM)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">DSc in Agricultural Systems Engineering (USP/Esalq)</span><u></u><u></u></p></div><div><p class="MsoNormal">Brazilian Agricultural Research Corporation (<span style="font-family:"Arial",sans-serif">Embrapa)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Dourados, MS, Brazil </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif">|<O>|</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><u></u><u></u></p></div></div></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">GEO, </span>-22.2752, -54.8182, 408m<u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">UTC-04:00 / DST: UTC-03:00</span><u></u><u></u></p></div><div><div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Em 12 de maio de 2016 10:09, Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>> escreveu:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Bom dia Eder,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Muito obrigado pela ajuda acredito que funcionara agora. Rodei teu exemplo e deu certo, porém quando rodei nos meus dados acusou um erro. Eu vou verificar o que esse erro. De toda forma, muito obrigado!</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt"><span lang="EN-US" style="font-size:10.0pt;font-family:"Lucida Console";color:#c5060b">Error in `[<-.data.frame`(`*tmp*`, sel[ord], "lance", value = c(1L, 0L : replacement has 2 rows, data has 75201</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Humberto</span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a> [mailto:<a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a>] <b>Em nome de </b>Éder Comunello<br><b>Enviada em:</b> quinta-feira, 12 de maio de 2016 08:23</span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>Para:</b> Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>><br><b>Cc:</b> <a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a><br><b>Assunto:</b> Re: [R-br] Criar uma coluna de lancamentos de pesca<u></u><u></u></p></div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Humberto, bom dia!</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Era para o script fazer isso mesmo, porque até então não havia presumido que precisaria reiniciar a contagem com a mudança do ano. Fiz outra alteração no script para atender esse critério.</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Via de regra, deve-se evitar aninhar instruções "for", mas acho que pode te servir como ponto de partida. Outros colegas da lista poderão te propor soluções mais elegantes...</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Courier New"">### <code r></span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df <- read.table(text=</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">"dia mes ano boat </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">13 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">10 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">11 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">12 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">9 1 2005 AGIOS.NIKOLAUS</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">10 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">9 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">12 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">13 1 2005 Y </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">11 1 2005 Y</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">13 1 2006 Y </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">11 1 2006 Y", head=T, <a href="http://as.is" target="_blank">as.is</a>=T)</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df$lance <- NA</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">for (boat in unique(df$boat)) {</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> for (ano in unique(df$ano)) {</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> sel <- which(df$boat==boat & df$ano==ano)</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> ord <- with(df[sel,], order(dia, mes, ano))</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> df[sel[ord], "lance"] <- 1:length(sel)</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> }</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">}</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># dia mes ano boat lance</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 1 13 1 2005 AGIOS.NIKOLAUS 5</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 2 10 1 2005 AGIOS.NIKOLAUS 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 3 11 1 2005 AGIOS.NIKOLAUS 3</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 4 12 1 2005 AGIOS.NIKOLAUS 4</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 5 9 1 2005 AGIOS.NIKOLAUS 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 6 10 1 2005 X 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 7 9 1 2005 X 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 8 12 1 2005 X 3</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 9 13 1 2005 Y 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 10 11 1 2005 Y 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 11 13 1 2006 Y 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 12 11 1 2006 Y 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">### </code></span><u></u><u></u></p></div></div></div><div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><div><div><div><div><div><div><div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif"></span><u></u><u></u></p></div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif"><br>Éder Comunello</span><u></u><u></u></p><div><p class="MsoNormal"><span style="font-size:9.5pt;font-family:"Arial",sans-serif">Agronomist (UEM), MSc in Environ. Sciences (UEM)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">DSc in Agricultural Systems Engineering (USP/Esalq)</span><u></u><u></u></p></div><div><p class="MsoNormal">Brazilian Agricultural Research Corporation (<span style="font-family:"Arial",sans-serif">Embrapa)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Dourados, MS, Brazil </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif">|<O>|</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><u></u><u></u></p></div></div></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">GEO, </span>-22.2752, -54.8182, 408m<u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">UTC-04:00 / DST: UTC-03:00</span><u></u><u></u></p></div><div><div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Em 11 de maio de 2016 19:17, Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>> escreveu:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Ola eder,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Mais uma vez obrigado e desculpa te incomodar de novo o problema é que esta um pouco estranho e diferente do teu resultado. Segue abaixo a partir do ponto amarelo deveria repetir 1 2 3...e não 16 17....</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black"> </span><span lang="EN-US" style="font-size:10.0pt;font-family:"Lucida Console";color:black">set.day setyear setmonth boat lance</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20404 14 1999 12 ACECHADOR 1</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20422 15 1999 12 ACECHADOR 2</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20403 17 1999 12 ACECHADOR 3</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20467 18 1999 12 ACECHADOR 4</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20466 19 1999 12 ACECHADOR 5</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20465 20 1999 12 ACECHADOR 6</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20473 21 1999 12 ACECHADOR 7</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20469 22 1999 12 ACECHADOR 8</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20468 23 1999 12 ACECHADOR 9</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20475 25 1999 12 ACECHADOR 10</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20470 26 1999 12 ACECHADOR 11</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20471 27 1999 12 ACECHADOR 12</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20472 28 1999 12 ACECHADOR 13</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20474 29 1999 12 ACECHADOR 14</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black">20476 30 1999 12 ACECHADOR 15</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black;background:yellow">26605 7 2000 1 ACECHADOR 16</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black;background:yellow">26592 8 2000 1 ACECHADOR 17</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black;background:yellow">26601 9 2000 1 ACECHADOR 18</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black;background:yellow">26603 10 2000 1 ACECHADOR 19</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black;background:yellow">26589 11 2000 1 ACECHADOR 20</span><u></u><u></u></p><p class="MsoNormal" style="line-height:11.25pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Lucida Console";color:black;background:yellow">25991 12 2000 1 ACECHADOR 21</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a> [mailto:<a href="mailto:ecomunel@gmail.com" target="_blank">ecomunel@gmail.com</a>] <b>Em nome de </b>Éder Comunello<br><b>Enviada em:</b> quarta-feira, 11 de maio de 2016 18:48<br><b>Para:</b> Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>><br><b>Cc:</b> <a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a></span><u></u><u></u></p><div><div><p class="MsoNormal"><br><b>Assunto:</b> Re: [R-br] Criar uma coluna de lancamentos de pesca<u></u><u></u></p></div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Humberto,</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Você poderia ordenar o banco antes de rodar:</span><span style="font-family:"Courier New""> df <- df[with(df, order(boat, ano, mes, dia)),]</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Ou modificar o código. Uma possibilidade:</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">### <code r></span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df <- read.table(text=</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">"dia mes ano boat </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">13 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">10 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">11 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">12 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">9 1 2005 AGIOS.NIKOLAUS</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">10 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">9 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">12 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">13 1 2005 Y </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">11 1 2005 Y", head=T, <a href="http://as.is" target="_blank">as.is</a>=T)</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df$lance <- NA</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">for (boat in unique(df$boat)) {</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> sel <- which(df$boat==boat)</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> ord <- with(df[sel,], order(dia, mes, ano))</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> df[sel[ord], "lance"] <- 1:length(sel)</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">}</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># dia mes ano boat lance</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 1 13 1 2005 AGIOS.NIKOLAUS 5</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 2 10 1 2005 AGIOS.NIKOLAUS 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 3 11 1 2005 AGIOS.NIKOLAUS 3</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 4 12 1 2005 AGIOS.NIKOLAUS 4</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 5 9 1 2005 AGIOS.NIKOLAUS 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 6 10 1 2005 X 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 7 9 1 2005 X 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 8 12 1 2005 X 3</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 9 13 1 2005 Y 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 10 11 1 2005 Y 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">### </code></span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><div><div><div><div><div><div><div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif"></span><u></u><u></u></p></div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif"><br>Éder Comunello</span><u></u><u></u></p><div><p class="MsoNormal"><span style="font-size:9.5pt;font-family:"Arial",sans-serif">Agronomist (UEM), MSc in Environ. Sciences (UEM)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">DSc in Agricultural Systems Engineering (USP/Esalq)</span><u></u><u></u></p></div><div><p class="MsoNormal">Brazilian Agricultural Research Corporation (<span style="font-family:"Arial",sans-serif">Embrapa)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Dourados, MS, Brazil </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif">|<O>|</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><u></u><u></u></p></div></div></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">GEO, </span>-22.2752, -54.8182, 408m<u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">UTC-04:00 / DST: UTC-03:00</span><u></u><u></u></p></div><div><div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Em 11 de maio de 2016 14:39, Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>> escreveu:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Muito obrigado Rodrigo e Elder,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">parcialmente o problema foi resolvido, entretanto olhando o resultado abaixo do código do Elder no meu banco de dados teria que estar classificado dia mês ano barco para que a sequência de lances darem certos correto? Ou pode ser incluída no código? Olhando o exemplo que esta em amarelo por exemplo o lance 3 deveria ser o lance 2.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><pre style="line-height:11.25pt;background:white"><span style="font-family:"Lucida Console";color:black"> </span><span lang="EN-US" style="font-family:"Lucida Console";color:black">set.day setyear setmonth boat lance</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:yellow">1 2 1978 8 SUMIYOSHI.MARU.32 1</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span lang="EN-US" style="font-family:"Lucida Console";color:black">2 4 1978 8 SEIKO.MARU.8 1</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:yellow">3 16 1978 4 SUMIYOSHI.MARU.32 2</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span lang="EN-US" style="font-family:"Lucida Console";color:black;background:yellow">4 13 1978 4 SUMIYOSHI.MARU.32 3</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span lang="EN-US" style="font-family:"Lucida Console";color:black">5 23 1978 9 SEIKO.MARU.8 2</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span lang="EN-US" style="font-family:"Lucida Console";color:black">6 7 1978 10 SUMIYOSHI.MARU.32 4</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span style="font-family:"Lucida Console";color:black">7 27 1978 1 SUMIYOSHI.MARU.32 5</span><u></u><u></u></pre><pre style="line-height:11.25pt;background:white"><span style="font-family:"Lucida Console";color:black">8 10 1978 1 SUMIYOSHI.MARU.8 1</span><u></u><u></u></pre><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> R-br [mailto:<a href="mailto:r-br-bounces@listas.c3sl.ufpr.br" target="_blank">r-br-bounces@listas.c3sl.ufpr.br</a>] <b>Em nome de </b>Éder Comunello<br><b>Enviada em:</b> quarta-feira, 11 de maio de 2016 11:23<br><b>Para:</b> <a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a><br><b>Assunto:</b> Re: [R-br] Criar uma coluna de lancamentos de pesca</span><u></u><u></u></p><div><div><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Humberto, bom dia!</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif">Segue uma uma sugestão, sem considerar que possa haver duplicidade...</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Verdana",sans-serif"> </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">### <code r></span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df <- read.table(text=</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">"dia mes ano boat </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">9 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">10 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">11 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">12 1 2005 AGIOS.NIKOLAUS </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">13 1 2005 AGIOS.NIKOLAUS</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">9 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">10 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">11 1 2005 X </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">12 1 2005 Y </span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">13 1 2005 Y", head=T, <a href="http://as.is" target="_blank">as.is</a>=T)</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df$lance <- NA</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">for (boat in unique(df$boat)) {</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> sel <- which(df$boat==boat)</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> df[sel, "lance"] <- 1:length(sel)</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">}</span><u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">df</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># dia mes ano boat lance</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 1 9 1 2005 AGIOS.NIKOLAUS 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 2 10 1 2005 AGIOS.NIKOLAUS 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 3 11 1 2005 AGIOS.NIKOLAUS 3</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 4 12 1 2005 AGIOS.NIKOLAUS 4</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 5 13 1 2005 AGIOS.NIKOLAUS 5</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 6 9 1 2005 X 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 7 10 1 2005 X 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 8 11 1 2005 X 3</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 9 12 1 2005 Y 1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""># 10 13 1 2005 Y 2</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">### </code></span><u></u><u></u></p></div></div></div><div><p class="MsoNormal"><br clear="all"><u></u><u></u></p><div><div><div><div><div><div><div><div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif"></span><u></u><u></u></p></div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><span style="font-size:9.5pt;font-family:"Arial",sans-serif"><br>Éder Comunello</span><u></u><u></u></p><div><p class="MsoNormal"><span style="font-size:9.5pt;font-family:"Arial",sans-serif">Agronomist (UEM), MSc in Environ. Sciences (UEM)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">DSc in Agricultural Systems Engineering (USP/Esalq)</span><u></u><u></u></p></div><div><p class="MsoNormal">Brazilian Agricultural Research Corporation (<span style="font-family:"Arial",sans-serif">Embrapa)</span><u></u><u></u></p></div><div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Dourados, MS, Brazil </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif">|<O>|</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">================================================</span><u></u><u></u></p></div></div></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">GEO, </span>-22.2752, -54.8182, 408m<u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial",sans-serif">UTC-04:00 / DST: UTC-03:00</span><u></u><u></u></p></div><div><div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div><div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Em 11 de maio de 2016 09:37, Humberto Hazin <<a href="mailto:hhazin@gmail.com" target="_blank">hhazin@gmail.com</a>> escreveu:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt"><div><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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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</span><u></u><u></u></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á<u></u><u></u></p><p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p><p class="MsoNormal"><span style="color:#888888">Humberto</span><u></u><u></u></p><p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p><p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p><p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p><p class="MsoNormal"><span style="color:#888888"> </span><u></u><u></u></p></div></div><p class="MsoNormal"><br>_______________________________________________<br>R-br mailing list<br><a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" 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" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<u></u><u></u></p></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></div></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></blockquote></div><p class="MsoNormal"> <u></u><u></u></p></div></div></div></div></div></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></blockquote></div><br></div>