I have a data that I'm plotting on ggplot2
as boxplots which look like
> head(varf)
sID variable value
1 SP_SA036,SA040 CM0001 0.492537313
2 SP_SA036,SA040 CM0001 0.479564033
3 SP_SA036,SA040 CM0001 0.559139785
4 SP_SA036,SA040 CM0001 0.526806527
5 SP_SA036,SA040 CM0001 0.009049774
6 SP_SA036,SA040 CM0001 0.451612903
The variable column contains 16 different IDs (from CM0001 to CM0016)
I have a dataframe with annotation
category annotation
CM001 HG4450
CM002 HG3288
..
CM016 MM8998
I would like to map these annotations on top of my boxplots but couldn't find a way to do it, what is the right syntax of using geom_text with boxplot ?
Thanks
There are many ways to approach this problem, e.g. here and here. Probably the simplest way is