|||
中英文混合版。
Function metaMDS performs Nonmetric Multidimensional Scaling (NMDS), and tries to find a stable solution using several random starts. In addition, it standardizes the scaling in the result, so that the configurations are easier to interpret, and adds species scores to the site ordination.
The metaMDS{vegan} functiondoes not provide actual NMDS, but itcalls another function for the purpose. Currently monoMDS {vegan} isthe default choice, and it is also possible to call the isoMDS (MASS package).
#---------------------------------------metaMDS-----------------------------------
FishEnv<- read.csv("~/FishEnv.csv")
View(FishEnv)
FishBio <- read.csv("~/FishBio.csv")
View(FishBio)
# 数据含义请参考博文:在R中正确运行ANOSIM——样品组间差异显著性检测及注意事项
# FishEnv.csv
#FishBio.Env
library("vegan")
distance.bray<-vegdist(FishBio,method = 'bray')
n<-metaMDS(distance.bray,k=2)
# plot(n,type='text')
# plot metaMDS in different colors for each group
op=plot(n,type = 'n')
#points
cols=c('darkred','green',’blue’,’pink’)
points(n,cex=2, pch=16, col=cols[FishEnv$Group])
#decoration
ordispider(n,groups = FishEnv$Group,label = TRUE) #add a spider lines for each species to centriod
ordihull(n,groups = FishEnv$Group,lty='dotted') #add hull convex for each Group.
legend('topright',pch=16,col=cols,legend =levels(FishEnv$Group))
n$stress
# [1] 0
# stress = 0
# over
相关博文:
1.正确作“系统(层次)聚类分析”之R(或Rstudio)应用
2.在R中正确运行PERMANOVA and pairwise comparison——样品组间差异显著性检验及注意点
3.在R中正确运行ANOSIM——样品组间差异显著性检测及注意点
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-21 20:05
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社