PCA plot with fill, color, and shape all together
This article is originally published at http://onetipperday.sterding.com/When I plotted the PCA results (e.g. scatter plot for PC1 and PC2) and was about to annotate the dataset with different covariates (e.g. gender, diagnosis, and ethic group), I noticed that it's not straightforward to annotate >2 covariates at the same time using ggplot.
Here is what works for me in ggplot:
pcaData <- plotPCA(vsd, intgroup = c( "Diagnosis", "Ethnicity", "Sex"), returnData = TRUE) # vsd and plotPCA are part of DESeq2 package, nothing with my example below.
df <- data.frame(x = runif(10), y = runif(10), sex = sample(c("m","f"), 10, rep = T))
I've not figured out a way to combine the two ideas above.
Thanks for visiting r-craft.org
This article is originally published at http://onetipperday.sterding.com/
Please visit source website for post related comments.