Try this:

with(DF, rowsum(quantity, identifier))


On Thu, Dec 2, 2010 at 2:24 PM, chris99 <chea...@hotmail.com> wrote:

>
> I am trying to aggregate data in column 2 to identifiers in col 1
>
> eg..
>
> take this>
>
> identifier       quantity
> 1                     10
> 1                     20
> 2                     30
> 1                     15
> 2                     10
> 3                     20
>
> and make this>
>
> identifier         quantity
> 1                    45
> 2                    40
> 3                    20
>
>
> Thanks in advance for your help!
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Help-summarizing-R-data-frame-tp3069624p3069624.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to