【发布时间】:2020-05-11 05:07:16
【问题描述】:
我正在绘制物种数据(556 个物种)和环境参数 (eiv) 的 cca,但在图中添加物种名称作为标签时遇到问题。物种名称在规格数据框的标题行中。
物种数据有 369 种草本植物、135 种苔藓植物和 52 种地衣物种,我试图在图中以不同的方式标记:
cca1<- vegan::cca(log1p(spec), log1p(eiv))
col<-c(rep("grey", 369), rep("red", 135),rep("green",52))
shp<- c(rep(1, 369), rep(15, 135),rep(17,52))
cex<- c(rep(0.5, 369), rep(0.7, 135),rep(0.7,52))
lgd<- c(rep("Herbs", 369), rep("Mosses",135), rep("Lichen",52))
spnames<-colnames(spec[,1:556])
ordiplot (cca1, display = 'sp', type = 'n', main ="CCA Alpine Species using EIV" )
points(cca1, display = "species", cex = cex, pch = shp, col = col, scaling=3)
text(cca1, display = "species",labels=spnames,scaling=3)
text(cca1, display = "bp", col = "grey40", cex = 0.8, scaling=3)
legend(x="topright", legend=unique(lgd), col = unique(col), pch = unique(shp))
当我运行 'text(cca1, display = "species",labels=spnames,scaling=3) 命令时,我收到此错误:
dimnames(x) 中的错误
这可能与这 3 个不同的物种群有关吗?尽管它们一起构成了 556 个物种?
【问题讨论】:
标签: r