在样本分布图中,而不是名称(在第一列中给出)中,为季节提供数字1,2,3,4。我有六个专栏(Season Annelida Decapoda Gastropoda Isopoda Pisces)。
mydata<- read.csv("IRI_diet.csv", TRUE, ",")
mydata[is.na(mydata)]=0
attach(mydata)
X=cbind (Annelida, Decapoda, Gastropoda, Isopoda, Pisces)
summary(X)
cor(X)
res.pca <- prcomp (X, scores=TRUE, cor=TRUE)
summary(res.pca)
fviz_pca_ind(res.pca,
col.ind = "cos2", # Color by the quality of representation
gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
repel = TRUE # Avoid text overlapping
)
这是情节
1: