Trim trailing whitespace on 3-char ICD-9 codes
Source:R/trim_trailing_whitespace.R
trim_trailing_whitespace.RdSome of the ICD-9 codes only contain 3 characters (i.e., they do not contain subcodes) but have a space at the end. This function just takes the record column and strips out the trailing space.
Examples
trim_trailing_whitespace(c("400 ", "402", "4032"))
#> [1] "400" "402" "4032"