intersectCodelists: Generate a codelist from the intersection of different...

View source: R/intersectCodelists.R

intersectCodelistsR Documentation

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

Description

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

Usage

intersectCodelists(x, keepOriginal = FALSE)

Arguments

x

A codelist.

keepOriginal

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

Value

A codelist

Examples


library(CodelistGenerator)
library(omock)

# Create a CDM object
cdm <- mockCdmReference()

# Intersect two codelists
codelist <- newCodelist(list("mood" = c(37110496L, 4226696L, 4304866L),
                             "manic" = c(37110496L, 4226696L)))

intersectCodelists(codelist, keepOriginal = TRUE)


# Intersect two codelists_with_details
codelist <- asCodelistWithDetails(codelist, cdm)

intersectCodelists(codelist, keepOriginal = FALSE)


CodelistGenerator documentation built on Dec. 17, 2025, 5:06 p.m.