<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.23569">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV><FONT color=#0000ff face=Arial>Por que quando rodo este comando não dá
certo?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>> aggregate(sp[c(F, F, T)], by = list(Ano =
sp$ano), sum)<BR>Error in aggregate(sp[c(F, F, T)], by = list(Ano = sp$ano),
sum) : <BR> object 'sp' not found<BR></DIV></FONT>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV><FONT size=2 face=Arial></FONT><BR></DIV>Muito obrigado
Rodrigo!<BR><BR><BR>Deu certo.<BR><BR><BR><BR>
<DIV class=moz-cite-prefix>Em 09-04-2014 13:24, Rodrigo Coster
escreveu:<BR></DIV>
<BLOCKQUOTE
cite=mid:CAKU4wovN+KYHpXge58WdrTpzdN2Bkz43O=XYjRT=h844ghFUfg@mail.gmail.com
type="cite">
<DIV dir=ltr>Alexandre,
<DIV><BR></DIV>
<DIV>Segue uma solução: aggregate(sp[c(F, F, T)], by = list(Ano =
sp$ano), sum)</DIV></DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>2014-04-08 21:45 GMT-03:00 Alexandre Loures <SPAN
dir=ltr><<A href="mailto:alexandre.loures@ymail.com" target=_blank
moz-do-not-send="true">alexandre.loures@ymail.com</A>></SPAN>:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV text="#000000" bgcolor="#FFFFFF">Rodrigo, é porque exclui as colunas
referentes ao mês e ano. Mas segue abaixo a saída considerando essas duas
colunas.<BR><BR>Com relação a quantidade de zeros, é porque na base já
aparece todos os meses para 2014 (jan, fev, mar, abr, ..., dez), todavia,
só há informações para janeiro e fevereiro. <BR><BR>Outro detalhe é que os
anos estão na ordem decrescente, ou seja, as primeiras linhas são para
2014 (e uma vez que pediu head está aparecendo somente para esse
ano).<BR><BR>As outras duas sugestões enviadas estão reportando o
somatório para a coluna toda, mas não é isso o que preciso. Preciso do
total para cada ano, ou seja, terá de ter uma linha com o total para 1997,
outra linha para 1998 assim sucessivamente até a última linha para o total
de 2014. <BR><BR><BR><BR><BR>> dput(head(sp))<BR>structure(list(ano =
c(2014L, 2014L, 2014L, 2014L, 2014L, 2014L<BR>), mes = structure(c(5L, 4L,
9L, 1L, 8L, 7L), .Label = c("ABR", <BR>"AGO", "DEZ", "FEV", "JAN", "JUL",
"JUN", "MAI", "MAR", "NOV", <BR>"OUT", "SET"), class = "factor"), `US$` =
c(38795229L, 63924605L, <BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L,
2014L, 2014L, 2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L),
.Label = c("ABR", <BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI",
"MAR", "NOV", <BR>"OUT", "SET"), class = "factor"), `US$` = c(33680798L,
51477786L, <BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(32400472L, 39645654L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(68022854L, 56066200L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(31881633L, 67045744L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(452118806L, 500158705L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(21795038L, 13562364L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(2730838L, 4259594L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(103132447L, 85622631L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(60353896L, 61121454L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(32403301L, 40519152L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(116570336L, 110079499L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(166832925L, 149309546L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(78060254L, 101650482L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(25985390L, 36699369L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(69222831L, 80306324L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(4392027L, 4567085L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(33752865L, 41537988L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(80216802L, 88982746L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(1489612L, 1465175L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(60973115L, 54078115L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(28441802L, 50033001L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(60420736L, 17987780L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(28824716L, 48507914L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(444712L, 328451L, <BR>0L,
0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L, 2014L<BR>), mes =
structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR", <BR>"AGO", "DEZ",
"FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV", <BR>"OUT", "SET"), class
= "factor"), `US$` = c(786654L, 838397L, <BR>0L, 0L, 0L, 0L), ano =
c(2014L, 2014L, 2014L, 2014L, 2014L, 2014L<BR>), mes = structure(c(5L, 4L,
9L, 1L, 8L, 7L), .Label = c("ABR", <BR>"AGO", "DEZ", "FEV", "JAN", "JUL",
"JUN", "MAI", "MAR", "NOV", <BR>"OUT", "SET"), class = "factor"), `US$` =
c(12933000L, 10051098L, <BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L,
2014L, 2014L, 2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L),
.Label = c("ABR", <BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI",
"MAR", "NOV", <BR>"OUT", "SET"), class = "factor"), `US$` = c(39827569L,
45256447L, <BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(58803226L, 76290276L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(46468076L, 38537192L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(53314093L, 33200142L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(34642085L, 23556561L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(119213241L, 121005345L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(274982262L, 244713051L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(74376824L, 35888744L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(2144991L, 2440378L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(114384520L, 74615518L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(54130383L, 62022477L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(3340357L, 4785296L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(3396350L, 3538952L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(7356480L, 6493192L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(30067652L, 34811828L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(10236714L, 14744233L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(21064904L, 28239710L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(5987416L, 9771117L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(16779486L, 11925052L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(9060866L, 13985017L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(15448503L, 24449350L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(8407209L, 20023742L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(38288341L, 43777071L,
<BR>0L, 0L, 0L, 0L), ano = c(2014L, 2014L, 2014L, 2014L, 2014L,
2014L<BR>), mes = structure(c(5L, 4L, 9L, 1L, 8L, 7L), .Label = c("ABR",
<BR>"AGO", "DEZ", "FEV", "JAN", "JUL", "JUN", "MAI", "MAR", "NOV",
<BR>"OUT", "SET"), class = "factor"), `US$` = c(610282312L, 508090709L,
<BR>0L, 0L, 0L, 0L)), .Names = c("ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$", "ano", "mes", "US$", "ano", "mes",
<BR>"US$", "ano", "mes", "US$"), row.names = c(NA, 6L), class =
"data.frame")<BR>> <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<DIV>Em 08-04-2014 21:13, Rodrigo Coster escreveu:<BR></DIV>
<DIV>
<DIV class=h5>
<BLOCKQUOTE type="cite">
<DIV dir=ltr>Era isso mesmo, mas eles pareceram meio estranho, pois tem
muita linha com 0... eu tava esperando mais uma coluna informando o mes
e ano e outras com as observações. Se os comandos sugeridos aqui (que
fazem a soma total da coluna) não funcionarem, da uma explicada de como
são os teus dados (a estrutura deles) que a gente resolve!</DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>2014-04-08 20:37 GMT-03:00 Alexandre Loures <SPAN
dir=ltr><<A href="mailto:alexandre.loures@ymail.com" target=_blank
moz-do-not-send="true">alexandre.loures@ymail.com</A>></SPAN>:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV text="#000000" bgcolor="#FFFFFF">Olá Rodrigo Coster!<BR><BR><BR>É
isto mesmo que você solicitou?<BR><BR><BR><BR>>
dput(head(sp))<BR>structure(c(38795229L, 63924605L, 0L, 0L, 0L, 0L,
33680798L, <BR>51477786L, 0L, 0L, 0L, 0L, 32400472L, 39645654L, 0L,
0L, 0L, <BR>0L, 68022854L, 56066200L, 0L, 0L, 0L, 0L, 31881633L,
67045744L, <BR>0L, 0L, 0L, 0L, 452118806L, 500158705L, 0L, 0L, 0L, 0L,
21795038L, <BR>13562364L, 0L, 0L, 0L, 0L, 2730838L, 4259594L, 0L, 0L,
0L, 0L, <BR>103132447L, 85622631L, 0L, 0L, 0L, 0L, 60353896L,
61121454L, <BR>0L, 0L, 0L, 0L, 32403301L, 40519152L, 0L, 0L, 0L, 0L,
116570336L, <BR>110079499L, 0L, 0L, 0L, 0L, 166832925L, 149309546L,
0L, 0L, 0L, <BR>0L, 78060254L, 101650482L, 0L, 0L, 0L, 0L, 25985390L,
36699369L, <BR>0L, 0L, 0L, 0L, 69222831L, 80306324L, 0L, 0L, 0L, 0L,
4392027L, <BR>4567085L, 0L, 0L, 0L, 0L, 33752865L, 41537988L, 0L, 0L,
0L, 0L, <BR>80216802L, 88982746L, 0L, 0L, 0L, 0L, 1489612L, 1465175L,
0L, <BR>0L, 0L, 0L, 60973115L, 54078115L, 0L, 0L, 0L, 0L, 28441802L,
<BR>50033001L, 0L, 0L, 0L, 0L, 60420736L, 17987780L, 0L, 0L, 0L,
<BR>0L, 28824716L, 48507914L, 0L, 0L, 0L, 0L, 444712L, 328451L, 0L,
<BR>0L, 0L, 0L, 786654L, 838397L, 0L, 0L, 0L, 0L, 12933000L,
10051098L, <BR>0L, 0L, 0L, 0L, 39827569L, 45256447L, 0L, 0L, 0L, 0L,
58803226L, <BR>76290276L, 0L, 0L, 0L, 0L, 46468076L, 38537192L, 0L,
0L, 0L, <BR>0L, 53314093L, 33200142L, 0L, 0L, 0L, 0L, 34642085L,
23556561L, <BR>0L, 0L, 0L, 0L, 119213241L, 121005345L, 0L, 0L, 0L, 0L,
274982262L, <BR>244713051L, 0L, 0L, 0L, 0L, 74376824L, 35888744L, 0L,
0L, 0L, <BR>0L, 2144991L, 2440378L, 0L, 0L, 0L, 0L, 114384520L,
74615518L, <BR>0L, 0L, 0L, 0L, 54130383L, 62022477L, 0L, 0L, 0L, 0L,
3340357L, <BR>4785296L, 0L, 0L, 0L, 0L, 3396350L, 3538952L, 0L, 0L,
0L, 0L, <BR>7356480L, 6493192L, 0L, 0L, 0L, 0L, 30067652L, 34811828L,
0L, <BR>0L, 0L, 0L, 10236714L, 14744233L, 0L, 0L, 0L, 0L, 21064904L,
<BR>28239710L, 0L, 0L, 0L, 0L, 5987416L, 9771117L, 0L, 0L, 0L, 0L,
<BR>16779486L, 11925052L, 0L, 0L, 0L, 0L, 9060866L, 13985017L, 0L,
<BR>0L, 0L, 0L, 15448503L, 24449350L, 0L, 0L, 0L, 0L, 8407209L,
20023742L, <BR>0L, 0L, 0L, 0L, 38288341L, 43777071L, 0L, 0L, 0L, 0L,
610282312L, <BR>508090709L, 0L, 0L, 0L, 0L), .Dim = c(6L, 51L),
.Dimnames = list(<BR> NULL, c("sp1", "sp2", "sp3",
"sp4", "sp5", "sp6", "sp7", <BR> "sp8", "sp9",
"sp10", "sp11", "sp12", "sp13", "sp14", "sp15", <BR>
"sp16", "sp17", "sp18", "sp19", "sp20", "sp21", "sp22", "sp23",
<BR> "sp24", "sp25", "sp26", "sp27", "sp28", "sp29",
"sp30", "sp31", <BR> "sp32", "sp33", "sp34", "sp35",
"sp36", "sp37", "sp38", "sp39", <BR> "sp40", "sp41",
"sp42", "sp43", "sp44", "sp45", "sp46", "sp47", <BR>
"sp48", "sp49", "sp50", "sp51")))<BR><BR><BR><BR><BR><BR>
<DIV>Em 08-04-2014 18:37, Rodrigo Coster escreveu:<BR></DIV>
<DIV>
<DIV>
<BLOCKQUOTE type="cite">
<DIV dir=ltr>Sem saber como são os teus dados fica complicado a
gente de dar um comando que certamente funcionará... da um
dput(head(dados)) e nos envia o que aparecer na tela</DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>2014-04-08 18:34 GMT-03:00 Daniel C Bezerra
<SPAN dir=ltr><<A href="mailto:danielcbezerra@gmail.com"
target=_blank
moz-do-not-send="true">danielcbezerra@gmail.com</A>></SPAN>:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV dir=ltr>apply(nomedobanco,2,sum)<BR></DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>2014-04-08 18:07 GMT-03:00 Alexandre Loures
<SPAN dir=ltr><<A href="mailto:alexandre.loures@ymail.com"
target=_blank
moz-do-not-send="true">alexandre.loures@ymail.com</A>></SPAN>:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV>
<DIV>
<DIV text="#000000" bgcolor="#FFFFFF">Olá pessoal!<BR><BR>Tenho
uma base de dados com 216 observações de 10 variáveis. Sendo que
essas observações são mensais, mas tenho que trabalhar com o
total anual.<BR><BR>Ou seja, eu tenho dados para os meses de
1997, 1998, 1999, 2000, ..., 2014. Mas quero os totais desses
anos em cada coluna.<BR><BR>Alguém saberia como fazer
isso?<BR><BR><BR><BR>Desde já muito obrigado!<SPAN><FONT
color=#888888><BR><BR><BR><BR>
<DIV>-- <BR><FONT size=1><B>Alexandre Rodrigues
Loures</B><BR></FONT></DIV></FONT></SPAN></DIV><BR></DIV></DIV>_______________________________________________<BR>R-br
mailing list<BR><A href="mailto:R-br@listas.c3sl.ufpr.br"
target=_blank
moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</A><BR><A
href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
target=_blank
moz-do-not-send="true">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
moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</A>) e
forneça código mínimo
reproduzível.<BR></BLOCKQUOTE></DIV><BR></DIV><BR>_______________________________________________<BR>R-br
mailing list<BR><A href="mailto:R-br@listas.c3sl.ufpr.br"
target=_blank
moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</A><BR><A
href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
target=_blank
moz-do-not-send="true">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
moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</A>) e
forneça código mínimo
reproduzível.<BR></BLOCKQUOTE></DIV><BR></DIV><BR>
<FIELDSET></FIELDSET> <BR><PRE>_______________________________________________
R-br mailing list
<A href="mailto:R-br@listas.c3sl.ufpr.br" target=_blank moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</A>
<A href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target=_blank moz-do-not-send="true">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</A>
Leia o guia de postagem (<A href="http://www.leg.ufpr.br/r-br-guia" target=_blank moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</A>) e forneça código mínimo reproduzível.</PRE></BLOCKQUOTE><BR></DIV></DIV><SPAN><FONT
color=#888888>
<DIV>-- <BR><FONT size=1><B>Alexandre Rodrigues
Loures</B><BR></FONT></DIV></FONT></SPAN></DIV><BR>_______________________________________________<BR>R-br
mailing list<BR><A href="mailto:R-br@listas.c3sl.ufpr.br"
target=_blank
moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</A><BR><A
href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
target=_blank
moz-do-not-send="true">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
moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</A>) e forneça
código mínimo reproduzível.<BR></BLOCKQUOTE></DIV><BR></DIV><BR>
<FIELDSET></FIELDSET> <BR><PRE>_______________________________________________
R-br mailing list
<A href="mailto:R-br@listas.c3sl.ufpr.br" target=_blank moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</A>
<A href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target=_blank moz-do-not-send="true">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</A>
Leia o guia de postagem (<A href="http://www.leg.ufpr.br/r-br-guia" target=_blank moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</A>) e forneça código mínimo reproduzível.</PRE></BLOCKQUOTE><BR></DIV></DIV><SPAN
class=HOEnZb><FONT color=#888888>
<DIV>-- <BR><FONT size=1><B>Alexandre Rodrigues Loures</B><BR>Doutorando
em Economia Aplicada<BR>Universidade Federal da Paraíba - UFPB<BR>Centro
de Ciências Sociais Aplicadas - CCSA<BR>Programa de Pós-Graduação em
Economia - PPGE<BR>Tel.: +55 32 9102-0690 (MG) ou +55 83 9804-1000
(PB)<BR>e-Mail: <A href="mailto:alexandre.loures@ymail.com" target=_blank
moz-do-not-send="true">alexandre.loures@ymail.com</A><BR>Site: <A
href="http://www.ccsa.ufpb.br/ppge" target=_blank
moz-do-not-send="true">www.ccsa.ufpb.br/ppge</A></FONT></DIV></FONT></SPAN></DIV><BR>_______________________________________________<BR>R-br
mailing list<BR><A href="mailto:R-br@listas.c3sl.ufpr.br"
moz-do-not-send="true">R-br@listas.c3sl.ufpr.br</A><BR><A
href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
target=_blank
moz-do-not-send="true">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 moz-do-not-send="true">http://www.leg.ufpr.br/r-br-guia</A>)
e forneça código mínimo reproduzível.<BR></BLOCKQUOTE></DIV><BR></DIV><BR>
<FIELDSET class=mimeAttachmentHeader></FIELDSET> <BR><PRE wrap="">_______________________________________________
R-br mailing list
<A class=moz-txt-link-abbreviated href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</A>
<A class=moz-txt-link-freetext href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</A>
Leia o guia de postagem (<A class=moz-txt-link-freetext href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</A>) e forneça código mínimo reproduzível.</PRE></BLOCKQUOTE><BR>
<DIV class=moz-signature>-- <BR><FONT size=1><B>Alexandre Rodrigues
Loures</B><BR>Doutorando em Economia Aplicada<BR>Universidade Federal da
Paraíba - UFPB<BR>Centro de Ciências Sociais Aplicadas - CCSA<BR>Programa de
Pós-Graduação em Economia - PPGE<BR>Tel.: +55 32 9102-0690 (MG) ou +55 83
9804-1000 (PB)<BR>e-Mail: <A class=moz-txt-link-abbreviated
href="mailto:alexandre.loures@ymail.com">alexandre.loures@ymail.com</A><BR>Site:
<A class=moz-txt-link-abbreviated
href="http://www.ccsa.ufpb.br/ppge">www.ccsa.ufpb.br/ppge</A></FONT></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>R-br mailing
list<BR>R-br@listas.c3sl.ufpr.br<BR>https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br<BR>Leia
o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo
reproduzível.</BLOCKQUOTE></BODY></HTML>