I am trying to obtain the significance letters with the function multcompLetters2( ) after performing a Pairwise Dunn Rank Sum Test with function dunnTest( ). However, after assigning the output of the test to an object (dunn.iris), I am unable to call it correctly in multcompLetters2( ). I am trying to refer only to the adjusted p values (P.adj) of the object, but I always get the following error message " Error in strsplit(x, sep) : non-character argument ".
I used "iris" dataset to make my problem reproducible.
# Packages
install.packages("ggpubr")
install.packages("tidyverse")
install.packages("rcompanion")
install.packages("multcompView")
install.packages("dunn.test")
install.packages("FSA")
library(rcompanion)
library(multcompView)
library(tidyverse)
library(ggpubr)
library(dunn.test)
library(FSA)
# Loading data
data("iris")
# Dunn's Test
dunn.iris <- dunnTest(iris$Sepal.Length, iris$Species, method = "bonferroni")
# Obtaining significance letters
cld <- multcompLetters2(Sepal.Length ~ Species, dunn.iris$Species[, "P.adj"], as.data.frame(iris))
Thank you !!!