ICD-9 CM code manipulation and validation in R