[R] how to add p values to bar plot?

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Sat Sep 28 04:28:58 CEST 2019


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-09-27 at 1.30.37 PM.png
Type: image/png
Size: 106834 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20190927/2a6eabb9/attachment.png>


More information about the R-help mailing list