<!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.23520">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial>Não consegui rodar o script, mesmo baixando
a bibliotéca data.table </FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=3></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=3>dply(dados, .(idade, sexo), summarize,
soma=sum(tcont), count = length(tcont))<BR>Error: could not find function
"ddply"<BR></DIV></FONT></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><FONT size=2 face=Arial></FONT><BR></DIV>
<DIV dir=ltr>Existe ainda uma outra alternativa nesse caso que é o uso do
data.table:<FONT
face=yw-594c7e313746b22beb7af390dfee778f98af89b0-b70ae8b3ca1d13417117c1ef2a149f80--o></FONT>
<DIV><FONT size=2 face=Arial></FONT><BR></DIV>
<DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><FONT color=#741b47
face="verdana, sans-serif">sexo=c("1","1","2","2","1","2","1","1","1","1","2")</FONT></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><FONT color=#741b47
face="verdana, sans-serif">idade=c("1","3","2","1","1","1","2","2","3","3","3")</FONT></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><SPAN
style="FONT-FAMILY: verdana,sans-serif; COLOR: rgb(116,27,71)">tcont=c(100,320,24,256,134,290,18,34,15,121,32)</SPAN><BR></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><FONT color=#741b47
face="verdana, sans-serif">read=c("1","0","0","0","1","1","1","1","1","1","0")</FONT></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><FONT color=#741b47
face="verdana, sans-serif">df=data.frame(sexo,idade,read,tcont)</FONT></DIV></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><FONT color=#741b47
face="verdana, sans-serif"><BR></FONT></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><FONT color=#741b47
face="verdana, sans-serif">require(data.table)</FONT></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><FONT color=#741b47 face="verdana, sans-serif">dt <-
data.table(df)</FONT></DIV>
<DIV style="FONT-FAMILY: arial,sans-serif; FONT-SIZE: 13px"
class=gmail_default><SPAN
style="LINE-HEIGHT: 16px; BACKGROUND-COLOR: rgb(225,226,229); BORDER-SPACING: 0px; BORDER-COLLAPSE: separate; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap; COLOR: rgb(0,0,0); FONT-SIZE: 14px"><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><SPAN style="COLOR: blue">dt[,list(soma=sum(tcont), count=.N), by=list(idade,sexo)]</SPAN></PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><BR></PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0>que é equivalente a :</PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><BR></PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><SPAN style="BORDER-SPACING: 0px; BORDER-COLLAPSE: separate"><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><SPAN style="COLOR: blue">ddply(dados, .(idade, sexo), summarize, soma=sum(tcont), count = length(tcont))</SPAN></PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><SPAN style="COLOR: blue"><BR></SPAN></PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0>ambos com saída:</PRE>
<PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><BR></PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><SPAN style="BORDER-SPACING: 0px; BORDER-COLLAPSE: separate"><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0> idade sexo soma count
1: 1 1 267 4
2: 2 2 570 3
3: 3 1 475 3</PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0><BR></PRE><PRE style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; LINE-HEIGHT: 1.2; MARGIN-TOP: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert; OUTLINE-WIDTH: medium; FONT-FAMILY: 'Ubuntu Mono'; WHITE-SPACE: pre-wrap !important; MARGIN-BOTTOM: 0px; FONT-SIZE: 10.4pt !important; BORDER-TOP: medium none; BORDER-RIGHT: medium none" tabIndex=0>O data.table tem uma grande vantagem sobre o plyr que é a velocidade. Quando o arquivo é muito grande ele pode chegar a ser 100x mais rápido.</PRE>
</SPAN></PRE></PRE></SPAN></PRE></SPAN></DIV></DIV></BLOCKQUOTE></BODY></HTML>