
Compare overlap between two sets of codes
compareCodelists.Rd
Compare overlap between two sets of codes
Examples
# \donttest{
cdm <- mockVocabRef()
#> Warning: There are observation period end dates after the current date: 2025-04-11
#> ℹ The latest max observation period end date found is 2025-12-31
codes1 <- getCandidateCodes(
cdm = cdm,
keywords = "Arthritis",
domains = "Condition",
includeDescendants = TRUE
)
#> Limiting to domains of interest
#> Getting concepts to include
#> Adding descendants
#> Search completed. Finishing up.
#> ✔ 3 candidate concepts identified
#> Time taken: 0 minutes and 0 seconds
codes2 <- getCandidateCodes(
cdm = cdm,
keywords = c("knee osteoarthritis", "arthrosis"),
domains = "Condition",
includeDescendants = TRUE
)
#> Limiting to domains of interest
#> Getting concepts to include
#> Adding descendants
#> Search completed. Finishing up.
#> ✔ 2 candidate concepts identified
#> Time taken: 0 minutes and 0 seconds
compareCodelists(
codelist1 = codes1,
codelist2 = codes2
)
#> # A tibble: 4 × 5
#> concept_id concept_name codelist_1 codelist_2 codelist
#> <int> <chr> <dbl> <dbl> <chr>
#> 1 3 Arthritis 1 NA Only codelist 1
#> 2 4 Osteoarthritis of knee 1 1 Both
#> 3 5 Osteoarthritis of hip 1 NA Only codelist 1
#> 4 2 Osteoarthrosis NA 1 Only codelist 2
# }