Skip to contents

Utility function to change the name of a cohort.

Usage

renameCohort(cohort, cohortId, newCohortName)

Arguments

cohort

A cohort table in a cdm reference.

cohortId

Vector identifying which cohorts to include (cohort_definition_id or cohort_name).

newCohortName

Character vector with same

Value

A cohort_table object.

Examples

# \donttest{
library(CohortConstructor)

cdm <- mockCohortConstructor(nPerson = 100)

settings(cdm$cohort1)
#> # A tibble: 1 × 2
#>   cohort_definition_id cohort_name
#>                  <int> <chr>      
#> 1                    1 cohort_1   

cdm$cohort1 <- cdm$cohort1 |>
  renameCohort(cohortId = 1, newCohortName = "new_name")

settings(cdm$cohort1)
#> # A tibble: 1 × 2
#>   cohort_definition_id cohort_name
#>                  <int> <chr>      
#> 1                    1 new_name   
# }