Learn R Programming

icd (version 2.2)

icd_condense: Condense ICD-9 code by replacing complete families with parent codes

Description

This can be thought of as the inverse operation to icd_children.

Usage

icd_condense(x, short_code = icd_guess_short(x), defined = NULL,
  warn = TRUE, ...)

# S3 method for character icd_condense(x, short_code = icd_guess_short(x), defined = NULL, ...)

icd9_condense_decimal(x, defined = NULL, warn = TRUE, keep_factor_levels = FALSE)

icd9_condense_short(x, defined = NULL, warn = TRUE, keep_factor_levels = FALSE)

Arguments

short_code

single logical value which determines whether the ICD-9 code provided is in short (TRUE) or decimal (FALSE) form. Where reasonable, this is guessed from the input data.

warn

single logical value, if TRUE, give warnings when there is discrepancy between onlyReal being TRUE yet data containing undefined codes.

...

arguments passed on to other functions

keep_factor_levels

single logical value, default FALSE. If TRUE, will reuse the factor levels from the input data for the output data. This only applies if a factor is given for the input codes.

icd9

is a character vector or factor of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010".

icd9Short

is a character vector of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010"

icd9Decimal

character vector of ICD-9 codes. If fewer than five characters is given in a code, then the digits are greedily assigned to hundreds, then tens, then units, before the decimal parts. E.g. "10" becomes "010", not "0010"

Methods (by class)

  • character: Condense a set of ICD codes, guessing ICD version from input data

See Also

Other ICD-9 ranges: icd_children, icd_expand_minor, icd_expand_range