subset_to_codes: Subset phenotype data to a given list of phecodes

Description Usage Arguments Value Examples

View source: R/helpers_for_main_dashboard.R

Description

Removes individuals who have none of the requested codes

Usage

1
subset_to_codes(data, desired_codes, codes_to_invert = c())

Arguments

data

A wide phenotype file with columns IID, snp, and all the normalized phecode names

desired_codes

Character vector of the phecodes to be extracted

codes_to_invert

Character vector of phecodes that the user has requested be inverted (e.g. not having the code is considered 'having' it.)

Value

A wide dataframe with just the columns desired and only rows corresponding to cases with one or more of the desired codes.

Examples

1
subset_to_codes(myPhenotypes, c('001.00', '002.00'), codes_to_invert = c('001.00'))

tbilab/meToolkit documentation built on June 23, 2020, 9:55 a.m.