When the stat_pvalue_manual
function of ggpubr is called:
ggplot + stat_pvalue_manual(statistics, label = "p.adj.signif",
coord.flip = TRUE,
#hide.ns = TRUE,
tip.length = 0,
bracket.size = 0)+coord_flip()
The following graph is produced:
However, I am only interested in data that is significant, therefore I have omitted non-significant data by calling hide.ns = TRUE
as follows:
ggplot + stat_pvalue_manual(statistics, label = "p.adj.signif",
coord.flip = TRUE,
hide.ns = TRUE,
tip.length = 0,
bracket.size = 0)+coord_flip()
This creates empty space that the non-significant data previously occupied. Is there a way to remove it?
To calculate the xy positions, this is done as follows in the statistics object:
statistics <- dataframe %>%
tukey_hsd(value~group) %>%
add_xy_position(fun = "mean_se", x= "group")
Thanks in advance!
I did this by filtering the statistics table to only show significant values.
statistics <- statistics %>% filter(p.adj.signif != "ns")
ggplot + stat.pvalue_manual(statistics, label = "p.adj.signif")