<p dir="ltr">Para tarefas desse tipo, split-combine-apply-summarise, recomendo o pacote plyr e dplyr.</p>
<p dir="ltr">À disposição.<br>
Walmes.</p>
<div class="gmail_quote">Em 28/03/2015 20:23, "Andre Oliveira" <<a href="mailto:andreolsouza@yahoo.com.br">andreolsouza@yahoo.com.br</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:10px"><div dir="ltr"><span><span><font face="times new roman, new york, times, serif" size="3">Pessoal tenho estes dados dentro do R, gostaria de criar um outro banco com a soma de cada item dos estados ao longo destes 10 anos. </font></span></span></div><div dir="ltr"><span><span><font face="times new roman, new york, times, serif" size="3"><br></font></span></span></div><div dir="ltr"><span><span><font face="times new roman, new york, times, serif" size="3"><br></font></span></span></div><div dir="ltr"><span><font size="5">str(dados)</font><br></span></div><div></div><div> <span style="font-family:'Ubuntu Mono';font-size:10.4pt;line-height:1.2;white-space:pre-wrap;background-color:rgb(225,226,229)">data.frame': 270 obs. of 7 variables:</span></div><span style="border-collapse:separate;border-spacing:0px;background-color:rgb(225,226,229)"><pre style="font-family:'Ubuntu Mono';font-size:10.4pt!important;line-height:1.2;white-space:pre-wrap;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px"> $ ANO : int 2005 2005 2005 2005 2005 2005 2005 2005 2005 2005 ...
$ UF : Factor w/ 27 levels "AC","AL","AM",..: 1 2 3 4 5 6 7 8 9 10 ...
$ OURO : int 0 1 2 0 15 14 7 7 2 0 ...
$ PRATA : int 15 15 15 15 15 15 15 15 15 15 ...
$ BRONZE: int 15 15 15 15 15 15 15 15 15 15 ...
$ MENCAO: int 136 543 718 98 2976 2242 306 377 859 830 ...
$ TOTAL : int 166 574 750 128 3021 2286 343 414 891 860 ...</pre><pre style="outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px"><font face="Ubuntu Mono"><span style="line-height:16.6399993896484px"><font size="5">head(dados)</font></span><span style="font-size:10.4pt!important;line-height:1.2"><br></span></font></pre><pre style="font-family:'Ubuntu Mono';font-size:10.4pt!important;line-height:1.2;white-space:pre-wrap;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px"><span style="border-collapse:separate;font-size:12px;line-height:normal;white-space:normal;border-spacing:0px"><table cellspacing="0" cellpadding="0" style="padding-left:6px;padding-bottom:8px;border:none;outline:none;word-wrap:break-word;width:597px;font-family:inherit!important;font-style:inherit!important;font-variant:inherit!important;font-weight:inherit!important;font-stretch:inherit!important;line-height:inherit!important;white-space:pre-wrap!important;font-size:10.4pt!important"><tbody><tr><td align="left" style="line-height:1.2;vertical-align:top;font-size:10.4pt!important"><pre style="font-family:'Ubuntu Mono';outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important">ANO UF OURO PRATA BRONZE MENCAO TOTAL
1 2005 AC 0 15 15 136 166
2 2005 AL 1 15 15 543 574
3 2005 AM 2 15 15 718 750
4 2005 AP 0 15 15 98 128
5 2005 BA 15 15 15 2976 3021
6 2005 CE 14 15 15 2242 2286
</pre></td></tr><tr><td align="left" style="line-height:1.2;vertical-align:top;font-size:10.4pt!important"></td></tr><tr><td align="left" style="line-height:1.2;vertical-align:top;font-size:10.4pt!important"><table cellspacing="0" cellpadding="0" style="width:597px"><tbody><tr><td align="left" width="1" height="" rowspan="1" style="line-height:1.2;vertical-align:top;font-size:10.4pt!important"><div style="white-space:pre-wrap;color:blue">> </div><div style="white-space:pre-wrap;color:blue"><br></div><div style="white-space:pre-wrap;color:blue"><br></div><div style="white-space:pre-wrap;color:blue"><br></div></td></tr></tbody></table></td></tr></tbody></table></span></pre><pre style="font-family:'Ubuntu Mono';font-size:10.4pt!important;line-height:1.2;white-space:pre-wrap;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px"><br></pre></span><div><div>
<br>
<br>André Oliveira Souza.
<br>Graduação em Matemática, mestrado em estatística aplicada.Instituto Federal de Educação, Ciência e Tecnologia do Espirito Santo. IFES
<br>
<br></div></div></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" 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.<br></blockquote></div>