[R] How to delete the replicate rows by summing up the numeric columns

Nikhil Kaza nikhil.list at gmail.com
Wed Jun 30 00:19:25 CEST 2010


require(reshape)
cast(data, first+second~ ., sum)


Nikhil Kaza
Asst. Professor,
City and Regional Planning
University of North Carolina

nikhil.list at gmail.com

On Jun 29, 2010, at 3:05 PM, Yi wrote:

> first=c('u','b','e','k','j','c','u','f','c','e')
> second
> =
> c
> ('usa
> ','Brazil
> ','England','Korea','Japan','China','usa','France','China','England')
> third=1:10
> data=data.frame(first,second,third)



More information about the R-help mailing list