0

我尝试使用 R 在箱线图上添加“p”值,但是当我使用 stat_compare_means 时出现错误。我在谷歌上快速查看,但我仍然不明白......

这是我尝试显示的箱线图:

boxplot <- ggplot(data, aes(x = Produit, y = P.cell.ouv)) +
  geom_boxplot() +
  scale_y_continuous(name ="Proportion de cellules vidées", limits=c(0,0.5)) +
  scale_x_discrete(name ="") +
  geom_text(data = myletters_df, aes(label = letter, y = 0.35 ), colour="black", size=5) +
  stat_compare_means( label.x = 0.7, method = "kruskal.test")

这里提出了错误

> boxplot
Don't know how to automatically pick scale for object of type quosure/formula. Defaulting to continuous.
Don't know how to automatically pick scale for object of type quosure/formula. Defaulting to continuous.
Error in validDetails.text(x) : 
  'pairlist' object cannot be coerced to type 'double'

我怎样才能解决这个问题?

4

0 回答 0