ここでは、種数のように一つの値(単変量)に変換したデータではなく、多次元のままのデータ(多変量)をグラフ化=可視化=グラフ化する方法を簡単に解説します。時間の関係上、詳しく説明できないので、以下のサイトも復習の際には参考にしてください(発展的内容)。多変量解析の基礎
ここでも、有効種数の計算のページで使ったサンプルデータ(species_biwa_data.rds)を使います。
まずはライブラリの読み込み、データとメタデータの読み込みです。
library(vegan)
#load the result
species_biwa_data <- readRDS("./species_biwa_data.rds")
#add information (metadata)
date_sampling <- c("2018Sep25", "2018Sep25", "2018Oct04","2018Oct04","2018Oct04","2018Oct25","2018Oct25")
#species_biwa_data <- cbind(date_sampling, species_biwa_data)
month_sampling <- c("Sep", "Sep", "Oct","Oct","Oct","Oct","Oct")
そして、植物プランクトンのデータを割合のデータに変換します。
#convert to the proportion
species_biwa_data2 <- decostand(species_biwa_data, method="total", MARGIN=1)
最後に(解説は割愛しますが)以下のコードを実行すれば何十種類ものプランクトン種に関する多次元データを次元削減し、2次元散布図としてプロットすることができます。
#PCoA based on Bray-Curtis dissimilarity
biwa_bc.d<-vegdist(species_biwa_data2, method="bray") #Bray-curtis dissimilarity
PCoA_biwa_bc <- cmdscale(biwa_bc.d, k = 2) #execute PCoA
x<-PCoA_biwa_bc[,1] #extract the position of each sample
y<-PCoA_biwa_bc[,2]
plot(x,y, cex=0.5) #2D scatter plot
text(x,y,label=month_sampling) #set the symbols
図は以下のようになります。