Learn R Programming

CohortConstructor (version 0.6.1)

renameCohort: Utility function to change the name of a cohort.

Description

Utility function to change the name of a cohort.

Usage

renameCohort(cohort, newCohortName, cohortId = NULL)

Value

A cohort_table object.

Arguments

cohort

A cohort table in a cdm reference.

newCohortName

Character vector with same

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.

Examples

Run this code
# \donttest{
library(CohortConstructor)
cdm <- mockCohortConstructor()

settings(cdm$cohort1)

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

settings(cdm$cohort1)
# }

Run the code above in your browser using DataLab