[R] Split dataframe by year

Rich Shepard rshepard at appl-ecosys.com
Mon Feb 10 18:10:18 CET 2014

On Mon, 10 Feb 2014, Zilefac Elvis 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.

   If you want two separate dataframes (while leaving the original), subset()
based on the year. For example, one dataframe would select year < 1961 and
the other new dataframe would select year > 1960.


Richard B. Shepard, Ph.D.          |      Have knowledge, will travel.
Applied Ecosystem Services, Inc.   |
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

More information about the R-help mailing list