create_indicator: Create a new indicator based on pattern in the argument expr

create_indicatorR Documentation

Create a new indicator based on pattern in the argument expr

Description

Create a new indicator based on pattern in the argument expr

Usage

create_indicator(data, new_name, expr, colvec, ignore.case = T, perl = T)

Arguments

data

input data

new_name

proposed name for the indicator

expr

regular expression describing the pattern of interest

colvec

indices or names of variables (where are the pattern) without quotes

ignore.case

logical

perl

logical

Value

new indicator matching the pattern described in the regular expression

Examples


library(dplyr)
library(injurymatrix)
icd10cm_data150 %>%
  create_indicator(new_name = "hero", expr = "T401.[1-4]", colvec = c(2:6))) %>%
  count(hero)


epinotes/injurymatrix documentation built on July 28, 2022, 12:34 a.m.