plot_pval_hist: Create an annotatied p-value histogram plot

View source: R/specific_plots.R

plot_pval_histR Documentation

Create an annotatied p-value histogram plot

Description

This function takes a vector of p-values and plots a histogram of them using ggplot. It will add horizontal lines at 1 and the estimated proportion of true null hypotheses for reference.

Usage

plot_pval_hist(pvals, nbins = 100, ptn = limma::propTrueNull)

Arguments

pvals

A vector of p-values

nbins

Number of bins in the histogram

ptn

Estimated proportion of true null hypotheses. If not provided, it will be estimated using limma::propTrueNull(). This can also be a function that takes one argument (the vector of p-values) and returns the estimated proportion of true null hypotheses, which should be a single number between 0 and 1.

Value

a ggplot object


DarwinAwardWinner/rctutils documentation built on July 22, 2022, 5:19 a.m.