Creates a QQ-plot of the p-values specified.
plot_pval_QQ( dataset, P, line_color = "black", line_size = 1, qq_color = "cornflowerblue", qq_shape = 20, save_plot_path = FALSE, plot_filename = "QQ-pvals.png" )
dataset | data imported to R by |
---|---|
P | column containing p-values to be plotted. State in the format dataset$P_value. |
line_color | color of the identity line. |
line_size | size of the identity line. |
qq_color | color of the points showing the quantiles of the p-values. |
qq_shape | shape of the points showing the quantiles of the p-values. |
save_plot_path | if |
plot_filename | name of the file to be saved, including file extension. Must be either .pdf, .png or .jpeg |
Either returns a ggplot
object or saves the plot to
save_plot_path
and returns NULL.
Use analysis_association()
to obtain p-values for an analysis and
import these with load_results()
.
Assumes p-values are uniformly distributed, and hence uses the uniform
distribution for the theoretical quantiles.
vignette("ggplot2-specs", package = "ggplot2")
details the usage of
aesthetic parameters in ggplot2.