addCodelistAttribute {PhenotypeR} | R Documentation |
Adds the cohort_codelist attribute to a cohort
Description
'addCodelistAttribute()' allows the users to add a codelist to a cohort in OMOP CDM.
This is particularly important for the use of 'codelistDiagnostics()', as the underlying assumption is that the cohort that is fed into 'codelistDiagnostics()' has a cohort_codelist attribute attached to it.
Usage
addCodelistAttribute(cohort, codelist, cohortName = names(codelist))
Arguments
cohort |
Cohort table in a cdm reference |
codelist |
Named list of concepts |
cohortName |
For each element of the codelist, the name of the cohort in 'cohort' to which the codelist refers |
Value
A cohort
Examples
library(PhenotypeR)
cdm <- mockPhenotypeR()
cohort <- addCodelistAttribute(cohort = cdm$my_cohort, codelist = list("cohort_1" = 1L))
attr(cohort, "cohort_codelist")
CDMConnector::cdmDisconnect(cdm)
[Package PhenotypeR version 0.1.5 Index]