dunn.letters | R Documentation |
Plotting helper function to add letters indicating statistically similar parings.
dunn.letters(levels, x, y, labels, col2 = col2, cex2 = cex2)
levels |
The number of groups |
x |
a list of x variables |
y |
a list of y variables |
labels |
what text do you want to include |
col2 |
color of the text label |
cex2 |
size of label |
Helper function to add letters indicating statitcal significance.
Use in combination with dunn.test::dunn.test() and rcompanion::cldList()
## Not run:
library(dunn.test)
library(rcompanion)
set.seed(123)
data=data.frame(group=c(rep("alpha",5),rep("beta",5),rep("delta",5)),value=c(runif(5,max=2),runif(5,min=4,max=10),runif(5,min=12,max=30)))
DT=with(data,dunn.test(value,group))
rslt=toupper(cldList(P.adjusted ~ comparison,data=DT,threshold = 0.05)$Letter)
boxplot(value~group,data,ylim=c(0,40))
dunn.letters(3,1:3,c(2,10,30),rslt,"red",1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.