I have team standings data where a column has entries of the form 'Xth of Y'. I need to convert these to numerical values on a 0 to 1 scale where 1st is 1, last is 0, and the remainder occur on a linear scale. I have considered strsplit(), but don't know what to do about some being '1st', some '2nd', etc. To give an example, my data looks like
x = as.factor(c('2nd of 6', '5th of 5', '4th of 5', '3rd of 5', '5th of 5', '4th of 7'))
Note: '2nd of 6' should convert to 0.8 and not 0.6666667