requireMinCohortCount {CohortConstructor} | R Documentation |
Filter cohorts to keep only records for those with a minimum amount of subjects
Description
requireMinCohortCount()
filters an existing cohort table, keeping only
records from cohorts with a minimum number of individuals
Usage
requireMinCohortCount(
cohort,
minCohortCount,
cohortId = NULL,
name = tableName(cohort)
)
Arguments
cohort |
A cohort table in a cdm reference. |
minCohortCount |
The minimum count of sbjects for a cohort to be included. |
cohortId |
Vector identifying which cohorts to modify (cohort_definition_id or cohort_name). If NULL, all cohorts will be used; otherwise, only the specified cohorts will be modified, and the rest will remain unchanged. |
name |
Name of the new cohort table created in the cdm object. |
Value
Cohort table
Examples
library(CohortConstructor)
cdm <- mockCohortConstructor(nPerson = 100)
cdm$cohort1 |>
requireMinCohortCount(5)
[Package CohortConstructor version 0.4.0 Index]