I have been given a data set with rows having the gene names and the column names being the genotype of the samples. Column names contain genotype of species and also their treatment (either A or B). How do I plot this in a PCA graph in R by their treatment?
Currently, I have made the matrix I need yet am completely stuck how to proceed. I have made a pca plot using:
library(tidyverse)
library(ggfortify)
df<- RGenes #RGenes being what i named my matrix
pca_res2<-prcomp(df,scale.=TRUE)
autopilot(pca_res2)