ProcessDfDefinitions: ProcessDfDefinitions

View source: R/ProcessdfDefinitions.R

ProcessDfDefinitionsR Documentation

ProcessDfDefinitions

Description

This function processes a tsv file with definitions and is automtically performed in CreateUKBiobankPhentoypes(). #It can be usefull to run this function as a check prior to running CreateUKBiobankPhentoypes

Usage

ProcessDfDefinitions(
  df,
  VctAllColumns = c("TS(Touchscreen)", "ICD10", "ICD9", "OPCS4", "OPCS3", "READ2",
    "READ2_drugs", "CTV3", "BNF", "DMD", "f.20001(sr_cancer)", "f.20002(sr_noncancer)",
    "f.20003(sr_med)", "f.20004(sr_oper)"),
  VctColstoupper = c("ICD10", "ICD9", "OPCS4", "OPCS3"),
  fill_dependencies = T
)

Arguments

df

definition table as dataframe

VctAllColumns

character vector containing all column names of interest (as shown in table) where preprocessing is performed

VctColstoupper

character vector containing all column names without brackets for which the characters in columns will be converted to uppercase.

fill_dependencies

For composite traits whether to further process dependencies in Include_definitions/Exclude_from_cases/Study_population/Exclude_from_controls columns, default: TRUE

Value

processed definitiion table as dataframe

Examples

dfDefinitions_processed <- ProcessDfDefinitions(fread("definitions.tsv", colClasses = 'character', data.table = FALSE))

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