first <- subset(dat1, dat1$var <=1960) Reverse inequality for the other one.
Hints on how to ask questions on R-help https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada > -----Original Message----- > From: zilefacel...@yahoo.com > Sent: Mon, 10 Feb 2014 08:58:11 -0800 (PST) > To: r-help@r-project.org, r-help-requ...@r-project.org > Subject: [R] Split dataframe by year > > Hi, > 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. > AT. > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. ____________________________________________________________ FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.com/photosharing to find out more! ______________________________________________ R-help@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.