I am making a volcano plot of some metabolomics data with ggplot2. It is working well and I have it colored to reflect p-value and fold change cut offs. However I'd like the dots to be deferentially colored based on the value in the column 'variable'.
volcano = ggplot(foldpg, aes(x=log2fold, y=logp, colour=posthreshold)) +
geom_point(alpha=0.5, size=2.5) +
theme(legend.position = "none") +
xlim(c(-5, 5)) + ylim(c(0, 12)) +
xlab("log2 fold change") + ylab("-log10 p-value")
volcano
the "variable" column of foldpg
has four possible values - I'd like a unique color for each.
Thanks