Re: [R] Split dataframe by year

2014-02-11 Thread John Kane
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

Re: [R] Split dataframe by year

2014-02-10 Thread Jeff Newmiller
Suggestions: 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,

Re: [R] Split dataframe by year

2014-02-10 Thread Rich Shepard
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() ba