[R] grouping data together
jrkrideau at yahoo.ca
Sat Nov 8 17:13:21 CET 2008
A very simple but long way to do this would be to subset your data set. There are better ways but this way would be easy to understand.
January <- subset(mydata, Month=="January")
Repeat for each month.
--- On Fri, 11/7/08, Swanton0822 <iverson0822 at hotmail.com> wrote:
> From: Swanton0822 <iverson0822 at hotmail.com>
> Subject: [R] grouping data together
> To: r-help at r-project.org
> Received: Friday, November 7, 2008, 6:03 PM
> i have a data, and there is 3 columns, Month, Year and
> Total. and there is
> over 1000 rows for them because there is 87 years data for
> every month, so
> there is month from Jan-Dec, and year from 1900-1987,
> so i was wondering if i would want to make 12 groups
> and put each year's total into the corresponding month
> (so every month group
> will have 88 values of total)
> how can i do that?
> many thanks.
> View this message in context:
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained,
> reproducible code.
[[elided Yahoo spam]]
More information about the R-help