我尝试使用R在箱线图上添加“ p”值,但是当我使用stat_compare_means时会引发错误。我在Google上快速浏览,但仍然不明白...
这是我尝试显示的箱线图:
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'
我该如何解决?