I would like to get a barplot with significance annotations. I am using the following three libraries: tidyverse, ggpubr, rstatix, and reprex.
I am using the dataset and code in this gist, just copy and paste and you have all you need: https://gist.github.com/drfalco/9402b52e1fee4c64ed3f1ca622344b99
Only the significance level in line 2 of 'stat.test.melt.dfi3.agree' is present in the final plot. Instead, the three significance levels in line 3, 4, 5 of 'stat.test.melt.dfi3.agree' are absent in the final plot. I get the following "Warning message: Removed 3 rows containing non-finite values (stat_bracket())."
Do you see anything wrong in 'stat.test.melt.dfi3.agree’? How could I get the three missing annotations on the plot?
You have set your
limitstoc(0, 5)inscale_y_continuousbutstat_pvalue_manualis trying to draw the brackets higher than 5. When you set y axis limits inggplot, you remove any geoms that are not within that range, and you get a warning about missing rows.All you need to do is to remove the
limitsargument, or set it to include all the brackets. The valuec(0, 5.45)seems pretty good: