I am trying to plot results of a Principal Component Analysis here based off of data, with age as a color coded factor onto the plot (as shown in the image attached in the link)
I want to make the visual better, by grouping age ranges instead of a continuous color range. For example, I would want to have three colors group1 being age 0-25, group2 from 26 to 50 and group3 being 51+. Is there a way I can manipulate this code to do that? I tried looking online for this but I am still unsure how to do that for this code set.
# Plot the PCA with color coding of age
fviz_pca_ind(proteome_pr, geom.ind = "point", pointshape = 21,
pointsize = 2,
fill.ind = prot_subjectID$Age,
col.ind = "black",
pallette = "jco",
label = "var",
col.var = "black",
repel = TRUE,
legend.title = "Age") +
ggtitle("Proteome Data and Age Correlation") + theme(plot.title = element_text(hjust = 0.5))