I have string like this:
years<-c(\"20 years old\", \"1 years old\")
I would like to grep only the numeric number from this vector. Expe
Or simply:
as.numeric(gsub("\\D", "", years)) # [1] 20 1