Skip to content

Allow custom list of codes #35

Description

@ellessenne

The idea is to allow the user passing a list of codes, e.g. a different comorbidity map.
Could use something like this to turn a list of codes into a regex:

list_of_codes <- c("I10", "I11", "I12")
make_regex <- function(x) {
  x <- paste(x, collapse = "|^")
  x <- paste0("^", x)
  return(x)
}
list_of_codes
#> [1] "I10" "I11" "I12"
make_regex(list_of_codes)
#> [1] "^I10|^I11|^I12"

Created on 2021-01-14 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions