icd_new_diag: Create a new variable based on pattern in the argument expr

Description Usage Arguments Value Examples

View source: R/icd_utils.R

Description

Create a new variable based on pattern in the argument expr

Usage

1
icd_new_diag(data, expr, colvec, ignore.case = T, perl = T)

Arguments

data

input data

expr

regular expression describing the pattern of interest

colvec

indices of variables of interest

ignore.case

logical

perl

logical

Value

new variable matching the pattern described in the regular expression

Examples

1
2
3
4
5
library(dplyr)
library(purrr)
icd10cm_data150 %>%
  mutate(hero = icd_new_diag(., expr = "T401.[1-4]", colvec = c(2:6))) %>%
  count(hero)

epinotes/useicd10cm documentation built on Oct. 18, 2021, 2:33 a.m.