I am working with the following character vector of fractions:
dput(my_vec)
c("85½", "75", "73", "91½", "93½", "68½", "74", "94½", "81½",
"67½", "96½", "71", "84½", "96½", "64½", "84½", "82½",
"81½", "94½", "74½", "76½", "73", "69½", "83", "81½", "85½",
"76", "77", "81", "92½")
and I need to convert this vector into an actual numeric vector with the values. Unfortunately, simply doing the following doesn't work:
> as.numeric(my_vec)
[1] NA 75 73 NA NA NA 74 NA NA NA NA 71 NA NA NA NA NA NA NA NA NA 73 NA 83 NA NA 76 77 81 NA
Warning message:
NAs introduced by coercion
Has anyone seen this before and would know how to handle getting these special character fractions into decimals in R? Thanks!