icd_first_match: a row operation that will form a vector of the first match of...

Description Usage Arguments Value Examples

View source: R/icd_utils.R

Description

a row operation that will form a vector of the first match of a pattern.

Usage

1
icd_first_match(data, new_name, colvec, pattern)

Arguments

data

input data

new_name

proposed name for the new variable

colvec

selected columns to match

pattern

the pattern to match

Value

return the vector of the matched characters with NA for a no match

Examples

1
2
3
4
dat <- data.frame(x1 = letters[1:3], x2 = c("d", "a", "e"))
library(dplyr)
library(purrr)
dat %>% icd_first_match(new_name = "x3", colvec = c(1:2), pattern = "a")

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