restrictPhecodesBySex: Restrict individuals for sex-specific phecodes

View source: R/restrictPhecodesBySex.R

restrictPhecodesBySexR Documentation

Restrict individuals for sex-specific phecodes

Description

restrictPhecodesBySex alters a table for PheWAS with phecodes, as from createPhenotypes, to exclude individuals with non-applicable sexes from certain phenotypes.

Usage

restrictPhecodesBySex(phenotypes,id.sex,sex.restriction=PheWAS::sex_restriction)

Arguments

phenotypes

The PheWAS table to have restrictions applied. The first column should be the id.

id.sex

A data frame with the first column being the id and the second the sex, "M" or "F", of the individual. Individuals with any other specification will have all sex-specific phenotypes set to NA.

sex.restriction

List that specifies sex-specific phecodes. By default uses the provided PheWAS::sex_restriction.

Value

The phenotypes data frame with NA values for individuals that do not match the sex for sex-specific codes.


PheWAS/PheWAS documentation built on July 3, 2023, 3:40 p.m.