create_indicator | R Documentation |
Create a new indicator based on pattern in the argument expr
create_indicator(data, new_name, expr, colvec, ignore.case = T, perl = T)
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 |
new indicator matching the pattern described in the regular expression
library(dplyr) library(injurymatrix) icd10cm_data150 %>% create_indicator(new_name = "hero", expr = "T401.[1-4]", colvec = c(2:6))) %>% count(hero)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.