I need extract start year and end year from a vector with values of these nature.
yr<- c("June 2013 – Present (2 years 9 months)", "January 2012 – June 2013 (1 year 6 months)","2006 – Present (10 years)","2002 – 2006 (4 years)")
yr
June 2013 – Present (2 years 9 months)
January 2012 – June 2013 (1 year 6 months)
2006 – Present (10 years)
2002 – 2006 (4 years)
I am expecting output like this. Does anyone have suggestions?
start_yr end_yr
2013 2016
2012 2013
2006 2016
2002 2006