Learn R Programming

CRMetrics (version 0.3.0)

addPlotStats: Add statistics to plot

Description

Use ggpubr to add statistics to plots.

Usage

addPlotStats(
  p,
  comp.group,
  metadata,
  h.adj = 0.05,
  primary.test,
  secondary.test,
  exact = FALSE
)

Value

ggplot2 object

Arguments

p

Plot to add statistics to.

comp.group

Comparison metric.

metadata

Metadata for samples.

h.adj

Position of statistics test p value as % of max(y) (default = 0.05).

primary.test

Primary statistical test, e.g. "anova", "kruskal.test".

secondary.test

Secondary statistical test, e.g. "t-test", "wilcox.test"

exact

Whether to calculate exact p values (default = FALSE).