You will need to add stat_compare_means. Take a look at here.
http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/76-add-p-values-and-significance-levels-to-ggplots/ library(ggpubr) p + stat_compare_means() Should be fine. Vivek On Fri, Sep 27, 2019 at 7:29 PM Ana Marija <sokovic.anamar...@gmail.com> wrote: > Hi, > > I created a bar plot with this code: > > library(ggplot2) > df <- data.frame("prop" = c(7.75,70.42), "Name" = c("All Genes","RG > Genes")) > p<-ggplot(data=df, aes(x=Name, y=prop,fill=Name)) + > geom_bar(stat="identity")+ labs(x="", y = "Proportion of cis > EQTLs")+ scale_fill_brewer(palette="Greens") + > theme_minimal()+theme(legend.position = "none") > p > > What do I need to change in my plot so that I have plot with p value > shown on the attached figure? > > Thanks > Ana > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- ---------------------------------------------------------- Vivek Das, PhD [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.