[R] GGplot annotate by facet

Khan, Saad M. (MU-Student) smk5g5 at mail.missouri.edu
Sat Sep 10 03:55:18 CEST 2016


Hi,

I have a dataframe which I need to plot in ggplot2 it looks like this :-

head(nodelta_firstexon)
  Value Type  Histone
1  0.06 high  H3K27ac
2  0.12  low  H3K27ac
4  0.04 high H3K27me3
5  0.16  low H3K27me3
7  0.02 high H3K36me3
8  0.13  low H3K36me3

I have another data frame with p-v alues that looks like this :-


head(mypval_df)

  Histone count pvalues

1   H3K9ac     0   0.000

2 H3K27me3     0   0.000

3 H3K36me3  1000   1.000

4  H3K4me3   583   0.583

5  H3K4me1   882   0.882

6  H3K27ac   970   0.970

This is how I plot the first dataframe  using ggplot
p <- qplot(factor(Value),data=nodelta_firstexon,geom="bar",fill=factor(Type))+facet_wrap(~Histone)

Next I need to annotate p-values (p <= mypval_df$pvalues)  to each facet using the mypval_df.

I can't seem to find an example on how to do it. Would appreciate any help.

Regards
Saad

	[[alternative HTML version deleted]]



More information about the R-help mailing list