我问了一个问题,这里,但现在又面临另一个问题
在从包cldList()运行rcompanion之后,它给了我一个表格,显示每个组的紧凑型字母显示,但是,一些组不显示任何字母,尽管与其他组没有显着性差异。
数据太大了,所以我要上传它这里
这是窃听器还是我做错了什么。
我使用的代码是这个
library(FSA)
library(multcompView)
library(rcompanion)
library(ggplot2)
library(ggpubr)
library(tidyr)
raw_df <- read.csv("raw_data.csv")
#After performing Kruskal-Wallis H test, I found significant groups and performed the post hoc test using dunnTest() using the code below
bells <- dunnTest(Group ~ as.factor(Color_Score), method = "bh", data = raw_df)
#I save the P values into a separate variable
piano <- bells$`res`
#After the Dunn Test, I tried to get the compact letter displays.
flute <- cldList(P.adj ~ Comparison, data = piano, threshold = 0.05)
#This is where the problem starts, overall, I have 40 groups to compare but would only return letters for 38 groups
#I tried plotting the boxplot and adding the compact letter using the code below
ggboxplot(raw_df, x = "Group", y = "Color_Score",
combine = FALSE,
x.text.angle = 360,
orientation = "vertical",
ylab = "Measurement (cm)",
xlab = "Group",
color = "Group",
fill = "Group",
notch = FALSE,
ggtheme = theme_gray()) +
font("xy.text", size = 7, color = "black") +
theme(legend.position = "None",
axis.text.x =element_text(color = "black")) +
color of the y-axis (Measurement) tick labels
geom_text(data = flute,
aes(x = Group, y = 12, angle = 90,
label = Letter),
position = position_nudge(x = 0.1),
hjust = 0,
color = "red")有人经历过吗?我试图寻找,但没有找到任何答案。
发布于 2021-11-26 16:06:23
我是cldList()函数的作者。由于该函数旨在处理来自不同函数的各种输出,因此默认情况下它会删除空格、零和等号等字符,这样就可以将结果传递给multcompView::multcompLetters。通过移除零,在本例中,它将C1与C10混为一谈。以下方法解决了这个问题:
flute <-
cldList(P.adj ~ Comparison,
data = bells$res,
threshold = 0.05,
remove.zero = FALSE)
flutehttps://stackoverflow.com/questions/69482320
复制相似问题