View source: R/stat_kwAllPairsDunnTest.R
stat_kwAllPairsDunnTest | R Documentation |
Uses PMCMRplus::kwAllPairsDunnTest()
to perform Dunn's non-parametric
all-pairs comparison test for Kruskal-type ranked data and adds the
resulting p-values to the plot.
Only works if the x-axis is a discrete scale.
stat_kwAllPairsDunnTest( mapping = NULL, data = NULL, geom = GeomStat, position = "identity", na.rm = FALSE, show.legend = NA, size = 10, hide.ns = TRUE, tick.length = 0.02, format.fun = pvalue, vjust = 0, step.increase = 0.05, colour = "black", inherit.aes = TRUE, ... )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
the geometric object to use display the data. Set to |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
size |
Fontsize for the annotation |
hide.ns |
Should p-values lower than 0.05 be removed? Default TRUE |
tick.length |
Length of the ticks in the p-value brackets. Default 0.02 |
format.fun |
A function used to format the p value. Default |
vjust |
A numeric vector specifying vertical justification. Passed on to textGrob. |
step.increase |
Amount of increase between two brackets. Default 0.05 |
colour |
Colour of the bracket and label |
inherit.aes |
If |
... |
Further arguments passed on to the layer in params |
A ggplot layer
library(ggplot2) library(ggsimplestats) theme_set(ggthemes::theme_few()) ggplot(PlantGrowth, aes(group, weight, fill = group)) + geom_boxplot() + stat_kwAllPairsDunnTest()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.