Learn R Programming

CodelistGenerator (version 4.1.0)

unionCodelists: Generate a codelist from the union of different codelists. The generated codelist will come out in alphabetical order.

Description

Generate a codelist from the union of different codelists. The generated codelist will come out in alphabetical order.

Usage

unionCodelists(
  x,
  newCodelistName = NULL,
  keepOriginal = FALSE,
  codelistsToJoin = names(x)
)

Value

A codelist

Arguments

x

A codelist, codelist_with_details, or a concept_set. See newCodelist(), newCodelistWithDetails(), newConceptSetExpression() functions for more details.

newCodelistName

Character vector with the name of the new codelist. If NULL all codelists names will be combined.

keepOriginal

Whether to keep the original codelist (TRUE) or just return the stratified ones (FALSE).

codelistsToJoin

Character vector with the names of the codelists to be unioned.

Examples

Run this code
# \donttest{
library(CodelistGenerator)
cdm <- mockVocabRef()
getDrugIngredientCodes(cdm,
                        nameStyle = "{concept_name}") |>
unionCodelists()
# }

Run the code above in your browser using DataLab