【发布时间】:2016-08-16 07:25:16
【问题描述】:
我正在使用以下代码进行 MDS 绘图,但在使用 pch 和 col 选项更改点符号和颜色时遇到了麻烦。这是我的代码:
library(vegan)
library(RColorBrewer)
xc <- cor(my.data, use = "pairwise.complete.obs", method = "spearman")
xc.dist <- dist(xc)
xcMDS <- monoMDS(xc.dist, k =2)
par(mar = c(5, 4, 1, 3))
plot(xcMDS, type = "n", ylim = c(-2,2), xlim = c(-2.5,2.5), las = 1, cex.axis = 0.75, xlab = "First dimension of non-metric \n multidimensional scaling (NMDS)", ylab = "Second dimension of NMDS", xaxp=c(-2,2,4), yaxp=c(-2,2,4))
cols= "#66C2A5"
points(xcMDS, col = cols, pch = 16)
这是错误信息:
Error in xy.coords(x, y) :
'x' is a list, but does not have components 'x' and 'y'
【问题讨论】: