View source: R/addPhecodeInfo.R
addPhecodeInfo | R Documentation |
addPhecodeInfo
adds the phecode description and group information, found in the data frame pheinfo
. Requires the full three digit phecodes in character format. This function replaces addPhewasDescription and addPhewasGroups.
addPhecodeInfo(data, descriptions=T, groups=T, groupnums=F, groupcolors=F)
data |
Data frame containing the a column with phecodes. Can additionally be a character vector of phecodes. See details for requirements. |
descriptions |
Add the phecode descriptions? Default is TRUE (yes). |
groups |
Add the phecode group names? Default is TRUE (yes). |
groupnums |
Add the phecode group numbers? Default is FALSE (no). Used in plotting |
groupcolors |
Add the phecode group colors? Default is FALSE (no). Used in plotting |
This function provides a quick way to add phecode descriptions and group names. It will select the first column matching any of "phecode", "phewas" or "pheno" to merge on. If none is identified, it reports a warning and attempts the merge with the first column. Phecodes must be character vectors, otherwise they may have inaccurate mappings. If PheWAS codes are factors it will convert them to characters, give a warning, and attempt to map them. If a character (or factor) variable or vector is passed in, it will return code descriptions for those codes.
Data frame with added columns:
description |
The description of the phecode. |
group |
The name of the phecode group. |
groupnum |
The assigned number of the phecode group. |
color |
The default plotting color of the phecode group. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.