Re: [R] Split a DF on Date column for each single year

2019-03-15 Thread Ek Esawi
Thank you Jeff and Rainer. I will try Jeff's idea using the sub string. function to extract the year and split on that. Thanks again to both--EK On Sat, Mar 16, 2019 at 1:52 AM Jeff Newmiller wrote: > > Couldn't you just use the substr function to pull the year out yourself to > make the groupi

Re: [R] Split a DF on Date column for each single year

2019-03-15 Thread Rainer Schuermann
In your sample data.frame, MyDate and MyDes are factors; is that what you want? rs On Samstag, 16. März 2019 01:40:01 CET Ek Esawi wrote: > Hi All— > > I have a data frame with over 13000 rows and 4 columns. A mini data > frame is given at the bottom. I want to split the data frame into > lists e

Re: [R] Split a DF on Date column for each single year

2019-03-15 Thread Jeff Newmiller
Couldn't you just use the substr function to pull the year out yourself to make the grouping column? On March 15, 2019 10:40:01 PM PDT, Ek Esawi wrote: >Hi All— > >I have a data frame with over 13000 rows and 4 columns. A mini data >frame is given at the bottom. I want to split the data frame in

[R] Split a DF on Date column for each single year

2019-03-15 Thread Ek Esawi
Hi All— I have a data frame with over 13000 rows and 4 columns. A mini data frame is given at the bottom. I want to split the data frame into lists each corresponds to single year which ranges from 1990 to 2018). I wanted to use the split function, but it requires a vector of the same length as My