Package: CohortConstructor 0.6.3.900

Edward Burn

CohortConstructor: Build and Manipulate Study Cohorts Using a Common Data Model

Create and manipulate study cohorts in data mapped to the Observational Medical Outcomes Partnership Common Data Model.

Authors:Edward Burn [aut, cre], Martí Català [aut], Nuria Mercade-Besora [aut], Marta Alcalde-Herraiz [aut], Mike Du [aut], Yuchen Guo [aut], Xihang Chen [aut], Kim Lopez-Guell [aut], Elin Rowlands [aut]

CohortConstructor_0.6.3.900.tar.gz
CohortConstructor_0.6.3.900.zip(r-4.7)CohortConstructor_0.6.3.900.zip(r-4.6)CohortConstructor_0.6.3.900.zip(r-4.5)
CohortConstructor_0.6.3.900.tgz(r-4.6-any)CohortConstructor_0.6.3.900.tgz(r-4.5-any)
CohortConstructor_0.6.3.900.tar.gz(r-4.7-any)CohortConstructor_0.6.3.900.tar.gz(r-4.6-any)
CohortConstructor_0.6.3.900.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
CohortConstructor/json (API)

# Install 'CohortConstructor' in R:
install.packages('CohortConstructor', repos = c('https://ohdsi.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ohdsi/cohortconstructor/issues

Pkgdown/docs site:https://ohdsi.github.io

Datasets:

On CRAN:

Conda:

10.84 score 10 stars 4 packages 232 scripts 1.4k downloads 52 exports 30 dependencies

Last updated from:f66de929aa. Checks:7 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64NOTE187
source / vignettesOK334
linux-release-x86_64NOTE183
macos-release-arm64NOTE124
macos-oldrel-arm64NOTE133
windows-develNOTE117
windows-releaseNOTE144
windows-oldrelNOTE132
wasm-releaseOK165

Exports:addCohortTableIndexattritionbenchmarkCohortConstructorbindcohortCodelistcohortCountcollapseCohortsconceptCohortcopyCohortsdeathCohortdemographicsCohortendDateColumnentryAtFirstDateentryAtLastDateexitAtDeathexitAtFirstDateexitAtLastDateexitAtObservationEndintersectCohortsmatchCohortsmeasurementCohortmockCohortConstructorpadCohortDatepadCohortEndpadCohortStartrenameCohortrequireAgerequireCohortIntersectrequireConceptIntersectrequireDemographicsrequireDurationrequireFutureObservationrequireInDateRangerequireIsEntryrequireIsFirstEntryrequireIsLastEntryrequireMinCohortCountrequirePriorObservationrequireSexrequireTableIntersectsampleCohortssettingsstartDateColumnstratifyCohortssubsetCohortstableNametimeWindowCohortstrimDemographicstrimDurationtrimToDateRangeunionCohortsyearCohorts

Dependencies:blobcliclockCodelistGeneratorcpp11DBIdbplyrdplyrgenericsgluejsonlitelifecyclemagrittromopgenericsPatientProfilespillarpkgconfigpurrrR6rlangsnakecasestringistringrtibbletidyrtidyselecttzdbutf8vctrswithr

Building base cohorts
Introduction | Concept based cohort creation | Demographic based cohort creation | Measurement Cohort | Death cohort

Last update: 2026-01-08
Started: 2024-05-10

Applying cohort table requirements
Keep only the first record per person | Keep only the last record per person | Keep only a range of records per person | Keep only records within a date range | Keep only if entry lasts a given duration | Applying multiple cohort requirements | Keep only records from cohorts with a minimum number of individuals

Last update: 2025-12-23
Started: 2024-08-28

Applying demographic requirements to a cohort
Restrict cohort by age | Restrict cohort by sex | Restrict cohort by number of prior observations | Applying multiple demographic requirements to a cohort

Last update: 2025-12-23
Started: 2024-08-28

Updating cohort start and end dates
Introduction | Exit at Specific Date | exitAtObservationEnd() | exitAtDeath() | Cohort Entry or Exit Based on Other Date Columns | entryAtFirstDate() | entryAtLastDate() | exitAtFirstDate() | exitAtLastDate() | Trim Dates Functions | trimDemographics() | trimToDateRange() | Pad Dates Functions | padCohortStart() | padCohortEnd() | padCohortDate() | Cohort ID argument

Last update: 2025-12-23
Started: 2024-08-28

Behind the scenes

Last update: 2025-11-01
Started: 2025-02-22

Applying requirements related to other cohorts, concept sets, or tables
Restrictions on cohort presence | Restrictions on concept presence | Restrictions on presence in clinical tables

Last update: 2025-10-21
Started: 2024-08-28

Concatenating cohort records

Last update: 2025-10-03
Started: 2024-08-28

Filtering cohorts

Last update: 2025-10-03
Started: 2024-08-28

Combining Cohorts

Last update: 2025-10-03
Started: 2024-08-28

Splitting cohorts
Introduction | stratifyCohorts | yearCohorts

Last update: 2025-10-03
Started: 2024-08-28

CohortConstructor benchmarking results
Introduction | Collaboration | Cohorts | Cohort counts and overlap | Performance | By definition | By domain | Cohort stratification

Last update: 2025-10-03
Started: 2024-09-10

Generating a matched cohort
Introduction | Create mock data | Use matchCohorts() to create an age-sex matched cohort | matchSex parameter | matchYear parameter | ratio parameter | Generate matched cohorts simultaneously across multiple cohorts

Last update: 2025-10-03
Started: 2024-08-28

Introduction
Building a cohort set by domain/ clinical table | Deriving study cohorts from base cohorts | Considerations when building cohorts

Last update: 2025-04-05
Started: 2024-05-11

Readme and manuals

Help Manual

Help pageTopics
Add an index to a cohort tableaddCohortTableIndex
Run benchmark of CohortConstructor packagebenchmarkCohortConstructor
Benchmarking resultsbenchmarkData
Collapse cohort entries using a certain gap to concatenate records.collapseCohorts
Create cohorts based on a concept setconceptCohort
Copy a cohort tablecopyCohorts
Create cohort based on the death tabledeathCohort
Create cohorts based on patient demographicsdemographicsCohort
Update cohort start date to be the first date from of a set of column datesentryAtFirstDate
Set cohort start date to the last of a set of column datesentryAtLastDate
Set cohort end date to death dateexitAtDeath
Set cohort end date to the first of a set of column datesexitAtFirstDate
Set cohort end date to the last of a set of column datesexitAtLastDate
Set cohort end date to end of observationexitAtObservationEnd
Generate a combination cohort set between the intersection of different cohorts.intersectCohorts
Generate a new cohort matched cohortmatchCohorts
Create measurement-based cohortsmeasurementCohort
Function to create a mock cdm reference for CohortConstructormockCohortConstructor
Set cohort start or cohort endpadCohortDate
Add days to cohort endpadCohortEnd
Add days to cohort startpadCohortStart
Utility function to change the name of a cohort.renameCohort
Restrict cohort on agerequireAge
Require cohort subjects are present (or absence) in another cohortrequireCohortIntersect
Require cohort subjects to have (or not have) events of a concept listrequireConceptIntersect
Restrict cohort on patient demographicsrequireDemographics
Require cohort entries last for a certain number of daysrequireDuration
Restrict cohort on future observationrequireFutureObservation
Require that an index date is within a date rangerequireInDateRange
Restrict cohort to specific entryrequireIsEntry
Restrict cohort to first entryrequireIsFirstEntry
Restrict cohort to last entry per personrequireIsLastEntry
Filter cohorts to keep only records for those with a minimum amount of subjectsrequireMinCohortCount
Restrict cohort on prior observationrequirePriorObservation
Restrict cohort on sexrequireSex
Require cohort subjects are present in another clinical tablerequireTableIntersect
Sample a cohort table for a given number of individuals.sampleCohorts
Create a new cohort table from stratifying an existing onestratifyCohorts
Generate a cohort table keeping a subset of cohorts.subsetCohorts
Split cohorts based on time-windowstimeWindowCohorts
Trim cohort on patient demographicstrimDemographics
Trim cohort dates to be within a certain interval of daystrimDuration
Trim cohort dates to be within a date rangetrimToDateRange
Generate cohort from the union of different cohortsunionCohorts
Generate a new cohort table restricting cohort entries to certain yearsyearCohorts