Hi folks! I need your help with a ggplot2 representation.
I have a data set that has the following structure:
log2FoldChange Sequence_biotype Knockdown -1.40 LTR A -1.11 DNA B -3.46 Protein A -1.25 Protein C 1.03 DNA B ... ... ...
I am plotting the foldChanges as boxplots, one for each
Sequence_biotype. I have the knockdown variable faceted.
What I'm trying to do is to do a one sample Wilcoxon test for each boxplot, comparing the log2FoldChange to 0 (to see if there is a significant change). That can be achieved with the following code:
wilcox.test(x = data, mu = 0)
when the data is grouped by Sequence_biotype and Knockdown.
My question is, how could I introduce the results of the wilcox test to the plot as labels or how could I compute it directly in the plot (I have been trying with
stat_compare_means(method = "wilcox", paired = FALSE) from ggpubr package but all the pvalues are piling up to the same spot)
Thank you before hand, any help is appreciated!