reformat_age(c("80 to 84", "90 or more", "85 to 89"))
## factor contains intermediate level missing from 'x'
reformat_age(c("80 to 84", "90 or more"))
## non-factor
reformat_age(c("80 to 84", "90 or more"),
factor = FALSE)
## single
reformat_age(c("80", "90plus"))
## life table
reformat_age(c("0",
"30-34",
"10--14",
"1-4 years"))
Run the code above in your browser using DataLab