I have a list of matrices I wish to plot. Each element in the list ultimately represents a facet to be plotted. Each matrix element has dimensions Row * Col, where all values in a row are grouped and plotted as a scatterplot (i.e. X-axis is categorical for the row names, Y-axis is the value, Col. values per row).
Additionally, I would like to add the CV for the distribution of points at each X.
X1 X2 value L1
a subject1 8.026494 facet1
b subject1 7.845277 facet1
c subject1 8.189731 facet1
(10 categorical groupings - a-j)
a subject2 5.148875 facet1
b subject2 8.023356 facet1
(33 subjects plotted for each categorical grouping)
a subject1 5.148875 facet2
b subject1 8.023356 facet2
(multiple facets (in my specific case, 50) with identical categorical grouping and subject names)
I managed to plot this to my satisfaction with the following:
p <- (qplot(X1, value, data=melt(df), colour=X2)
+ facet_wrap(~Probeset, ncol=10, nrow=5, scales="free_x"))
However, I would like to add the CV of each grouping of points along the X-axis as a label hovering above the group. I tried variations on this:
p + geom_text(aes(x=X1, y="arbitrary value at the top of the Y-axis scale", label="vector of labels")))
But none of them behaved as I wish. How would I go about getting the CV of each group above the group of points, as a label?
Thank you in advance!