get_case_status_by_source: Get case-control status (Hx) by data sources used for upset...

get_case_status_by_sourceR Documentation

Get case-control status (Hx) by data sources used for upset plot

Description

Given a phenotype, a list of episode data and reference dates per individual, identify cases and control status as of *reference date" by source.

Usage

get_case_status_by_source(
  definition,
  lst.data,
  df.data.settings,
  df.reference.dates = NULL,
  keep_any = FALSE,
  keep_id = FALSE
)

Arguments

lst.data

list of data table with all episode data

definitions

phenotype/trait specified in definition table (a row in the table)

lst.data.settings

data frame containing data settings

reference_date

reference dates for each individuals in the whole cohort as a named vector

vct.identifiers

character vector listing the identifiers in the cohort. This is used to define controls if reference_date is not given

Value

a data table : case control status according to different sources and one column based on any of the sources.

Examples

get_case_status_by_source(cancer_source,definition=dfDefinitions_processed_expanded %>% filter(TRAIT=="Nicm"), lst.data,lst.data.settings,lst.identifiers=dfukb$f.eid))

niekverw/ukbpheno documentation built on Oct. 30, 2023, 9:17 p.m.