'How can I see my full PCA data on the ordination map? and how can I change geom point colors of my data in R?
I am using a package called Vegan to calculate the PCA of my environmental samples and then plot my PCA values on the ordination space in R, I am using the data from an excel sheet where certain columns are chosen for the PCA calculation as below:
library(vegan)
library("readxl")
library(devtools)
SRSummer21 <- read_excel(file.choose())
SRSummer21PCA <- rda(SRSummer21[,c(3:17)], scale = TRUE)
summary(SRSummer21PCA)
ordiplot (SRSummer21PCA, display = 'species', type = 't')
ef <- envfit (SRSummer21PCA, SRSummer21[,c(41:43)])
plot (ef)
I try to add 3 other variables on top of the PCA calculation, as I don't want them to be in the original calculation, they are "Alkalinity", "Conductivity", and "pH", which are in columns 41 to 43 in my datasheet. Now when I plot the data, it gives me a simple plot with a set of black geom points as my data, however, I can't completely see the arrows of the data I added on top, I need to fit in the image so that all data and arrows can be seen in the space, I also like to change the shape and color of my data points according to their "Treatment" which is either of 3 different values: Cold, Moderate, Warm, which are written in column "Treatment" of my excel datasheet. you can see that part of the alkalinity arrow is present but the rest I can't see
Does anyone know how I can do this?
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
