% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/unionCodelists.R
\name{unionCodelists}
\alias{unionCodelists}
\title{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)
)
}
\arguments{
\item{x}{A codelist, codelist_with_details, or a concept_set. See \code{newCodelist()}, \code{newCodelistWithDetails()}, \code{newConceptSetExpression()} functions for more details.}

\item{newCodelistName}{Character vector with the name of the new codelist. If
NULL all codelists names will be combined.}

\item{keepOriginal}{Whether to keep the original codelist (TRUE) or just return
the stratified ones (FALSE).}

\item{codelistsToJoin}{Character vector with the names of the codelists to be
unioned.}
}
\value{
A codelist
}
\description{
Generate a codelist from the union of different codelists. The generated codelist
will come out in alphabetical order.
}
\examples{
\donttest{
library(CodelistGenerator)
cdm <- mockVocabRef()
getDrugIngredientCodes(cdm,
                        nameStyle = "{concept_name}") |>
unionCodelists()
}
}
