Ciao Gianni,

take a look at ?aggregate

bests

milton

On Thu, Apr 8, 2010 at 2:39 PM, gianni lavaredo
<gianni.lavaredo@gmail.com>wrote:

> Dear Reseachers,
>
> I need a suggestion to know How I can sum value inside the same row in
> function of the same ID
>
> p <-
>
> data.frame(ID=c(1,2,3,4,5,6,1,2,3,4,6),x=c(10,10,10,10,10,10,10,10,10,10,10))
>
> > p
>   ID  x
> 1   1 10
> 2   2 10
> 3   3 10
> 4   4 10
> 5   5 10
> 6   6 10
> 7   1 10
> 8   2 10
> 9   3 10
> 10  4 10
> 11  6 10
>
> I wish to obtain the same result
> ID x
> 1 20
> 2 20
> 3 20
> 4 20
> 5 10
> 6 20
>
> thanks
> Gianni
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

