add_icd_category: Add a column of ICD categories to a data.frame

Description Usage Arguments Examples

View source: R/add_icd_category.R

Description

Add a column of ICD categories to a data.frame

Usage

1
2
3
4
5
6
7
8
add_icd_category(
  icd,
  icd_column,
  icd_type = c("diagnosis", "procedure"),
  icd_lookup_column = "global_short_description",
  parallel = FALSE,
  cluster_num = parallel::detectCores() - 1
)

Arguments

icd

A data.frame with ICD 9 or 10 diagnoses.

icd_column

The name of the column of ICD codes.

icd_type

Are these diagnosis or procedure codes (diagnosis default).

icd_lookup_column

Which column from icd_lookup should be returned. You can see this data frame by running data(icd_lookup).

parallel

Use parallel processing?

cluster_num

Number of clusters to use if parallel is TRUE.

Examples

1
2
3
x <- data.frame(icd = c("43852", "M93929", "W002XXA"))

add_icd_category(icd = x, icd_column = "icd")

NateByers/IUHhelpers documentation built on Feb. 25, 2020, 8:43 p.m.