關于做PLS-DA分析
2022-12-09 03:25 作者:農(nóng)夫微甜Kew | 我要投稿
這里分析一個做pls-da的R包,多一種選擇。了解相關內(nèi)容可以查閱下邊鏈接,這里不多介紹。
資料:https://mixomicsteam.github.io/Bookdown/plsda.html
#需要數(shù)據(jù)包
library(mixOmics)
library(dplyr)
library(tidyverse)
以下數(shù)據(jù),僅參考。
#數(shù)據(jù)
?head(data.plsda)

# 選擇分析數(shù)據(jù)
VOC.soil.C = subset(data.plsda, Treatment=="C")
VOC.soil.C.plsda<- as.matrix(VOC.soil.C[,13:46])
#運行
VOC.soil.C.plsda1 <- splsda(VOC.soil.C.plsda, VOC.soil.C$Season)
#數(shù)據(jù)點圖
plotIndiv(VOC.soil.C.plsda1)

#變量圖
plotVar(VOC.soil.C.plsda1)

#
plotIndiv(VOC.soil.C.plsda1, ind.names = FALSE, legend=T,
? ? ? ? ? ellipse = TRUE, star = TRUE, title = 'Treatment: C',
? ? ? ? ? X.label = 'Component 1 (30%)', Y.label = 'Component 2 (18%)')

標簽: