Depending on if a phecode was ever converted to a number or not it can show up in a million different formats. This standardizes everything to a 6 digits number.

normalize_phecodes(codes)

Arguments

codes

A vector of phecodes in whatever format your heart desires. E.g. 8.00, 8, 0008.0, ...

Value

A vector of 0-padded phecodes.

Examples

normalize_phecodes(c(8, 8.1, 9.2, 23.4))
#> [1] "008.00" "008.10" "009.20" "023.40"