powered by
sampleCohorts() samples an existing cohort table for a given number of people. All records of these individuals are preserved.
sampleCohorts()
sampleCohorts(cohort, cohortId = NULL, n, name = tableName(cohort))
Cohort table with the specified cohorts sampled.
A cohort table in a cdm reference.
IDs of the cohorts to include. If NULL all cohorts will be considered. Cohorts not included will not be sampled.
Number of people to be sampled for each included cohort.
Name of the new sampled cohort.
# \donttest{ library(CohortConstructor) cdm <- mockCohortConstructor(nPerson = 100) cdm$cohort2 |> sampleCohorts(cohortId = 1, n = 10) # }
Run the code above in your browser using DataLab