kassambara / ggpubr

'ggplot2' Based Publication Ready Plots
https://rpkgs.datanovia.com/ggpubr/
1.13k stars 165 forks source link

Adding statistical values to my graph = Computation failed in `stat_signif()`: missing value where TRUE/FALSE needed #361

Open miguensblanco opened 3 years ago

miguensblanco commented 3 years ago

Hi and thanks for this great package.

I am able to get the statistical analysis of my 3 diffefrent groups (global p value as in the graph attached) but when I try to perform pairwise comparation between the different groups is when I get: Computation failed in stat_signif(): missing value where TRUE/FALSE needed

Shannon_Kruskal-Wallis

The code I am using:

my_comparisons <- list( c("T2_NAFLD", "T2DM"), c("T2_NAFLD_stiffness", "T2_NAFLD"), c("T2DM", "T2_NAFLD_stiffness") )

p1 <- ggviolin(ps1.meta, x = "Groups", y = "Shannon",
               add = "boxplot",add.params = list(fill = "white") , fill = "Groups", palette = c("#00AFBB", "#E7B800", "#FC4E07")) 

p2 <- p1 + stat_compare_means(comparisons = my_comparisons) + stat_compare_means(label.y = 7) 

print(p2)

I'd appreciate any tip in this particular dates :))

Best,

JMB

pdhrati02 commented 2 years ago

@miguensblanco Hi, were you able to solve this issue? I am getting the same error. Thanks

shuaifengwang commented 1 month ago

Hi, when I used my own data, the error was appeared, bu the example data is ok , why?