phewasDT: Wrapper to create a browsable datatable

View source: R/phewasDT.R

phewasDTR Documentation

Wrapper to create a browsable datatable

Description

This function returns a DT from the pacakge DT that has commonly used columns in an easy to browse format.

Usage

phewasDT(results, addPhecodeInfo=T, OR.digits=2, p.digits=3, ...)

Arguments

results

The results data frame from phewas.

addPhecodeInfo

Add the phecode information? Default is TRUE, which works with a phecode PheWAS. FALSE requires the inclusion of a "description" column.

OR.digits

Digits after the decimal place for the odds ratio (passed as the digits parameter to round). Default is 2.

p.digits

Digits after the decimal place for the p-value (passed as the digits parameter to round). Default is 3.

...

Parameters to pass to datatable

Details

This function is a short wrapper to create an easily browsable datatable using the package DT. It has few options, but this function serves as an instructive example as the interior calls of the function can be easily adapted to suit other purposes.

Author(s)

Robert Carroll

See Also

createPhewasTable

Examples


#Generate some example data
ex=generateExample(hit="335")
#Extract the two parts from the returned list
id.icd9.count=ex$id.icd9.count
genotypes=ex$genotypes
#Create the PheWAS code table- translates the icd9s, adds exclusions, and reshapes to a wide format
phenotypes=createPhewasTable(id.icd9.count)
#Run the PheWAS
results=phewas(phenotypes,genotypes,cores=4)
#Create a quick datatable for results review
phewasDT(results)


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