Re: [R] How to delete rows based on replicate values in one column with some extra calcuation

From: Nikhil Kaza <nikhil.list_at_gmail.com>
Date: Mon, 28 Jun 2010 22:58:37 -0400

aggregate(data$third, by=list(data$first), sum)

or

reqiure(reshape)
cast(melt(data), ~first, sum)

On Jun 28, 2010, at 9:30 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)



R-help_at_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. Received on Tue 29 Jun 2010 - 03:15:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Jun 2010 - 02:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive