I have a df, such that a row looks like:
name datesemployed university
Kate Oct 2015 – Jan 2016 Princeton
What I want to do is repeat the entire row for each year in the range of variable datesemployed
.
In this case, there would be two rows --- one for 2015, and one for 2016.
I've attempted to clean the variable first, but even having a tough time on how to do that:
df3<-str_split_fixed(df$datesemployed, "–", 2)
df<-cbind(df3, df)