View source: R/death_functions.R
death_icd10_clean | R Documentation |
This function prepares ICD-10 codes for processing with the death functions
in the rads
package.
death_icd10_clean(icdcol)
icdcol |
A character vector containing ICD-10 codes. |
This function prepares ICD-10 codes for processing with the death functions
in the rads
package. It performs cleaning and tidying operations, such as
converting codes to uppercase, removing non-alphanumeric characters (e.g.,
hyphens and periods), validating the ICD-10 code format, trimming codes to a
maximum of 4 characters, and padding shorter codes with zeros when needed.
It is used internally by rads
death functions but can also be used as a
standalone function.
A cleaned and standardized character vector of ICD-10 codes.
icd_codes <- c("A85.2", "B99-1", "J20.9", "INVALID", "C34")
cleaned_icd_codes <- death_icd10_clean(icd_codes)
print(cleaned_icd_codes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.