[R] combining rows

Kang Tu kang.tu.rfan at gmail.com
Mon Sep 5 02:16:31 CEST 2011


Would you mind show us a simple example of your data? It is hard to
understand your request directly from your text. 

If you just want to combine the data, you can try cbind() function
directly, or you can use subset() function to get a subset of your
data.frame. If you want to selectively aggregate some statistics you can
try aggregate() function. If you want a more complex aggregation, you
may want to try ddply() in 'plyr' package.

On Sun, 2011-09-04 at 15:25 -0700, joonsum wrote:
> First time using R and have so many basic questions. 
> 
> The problem that I have confronted is combining rows. I have a data frame
> that contains daily rain falls from 60 to 80. There are 27 columns which are
> Year,month, day, and record in hours.
> 
> I am trying to combine the 4th column to the 27th to get daily rain fall
> data. 
> rowSums() works in the case of merging all rows but in my case, I need to be
> selective. How should I start?  
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/combining-rows-tp3790068p3790068.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.



More information about the R-help mailing list