Sample of data:
Outcome
<chr>
1 X2016-17Denominator
2 X2014-15Denominator
3 X2014-15Outcome
4 X2010-11Numerator
5 X2012-13Denominator
I'm a bit uncertain how to use the sep argument in the separate function provided by the tidyr package. I'm still a newbie at using regex but I figured something like this would work:
sample %<>% separate(Outcome, into=c("date", "metric"), sep="^X[:digit:]{4}[:punct:][:digit:]{2}")
This creates the metric column fine, but leaves the date column empty. I'm guessing the issue is that what is considered the "separator" isn't replicated, but I'm not sure how to specify the characters after X####-## as what I want the columns to be separated by.