[R] Split dataframe by year

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon Feb 10 18:49:47 CET 2014


Read the posting guide mentioned at the bottom of this email. Note request to post in plain text and provide reproducible example. Knowing how your data are constructed allows us to make more concrete suggestions as to how Rio solve your problem.

Read help files: ?"%in%", ?subset, ?"<", ?"&". These may seem dense at first, but you eventually need to absorb them so get started.

Read the "Introduction to R" document that is supplied with the R software. In particular, read about indexing with logical vectors. 
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

On February 10, 2014 8:58:11 AM PST, Zilefac Elvis <zilefacelvis at yahoo.com> wrote:
>I have a dataframe in R and would like to split the data (1900-1980)
>into two sets.
>For example, one dataframe should have data from 1900-1960 and the
>other from 1961-1980.
>Thanks for your help.
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list