【问题标题】:Vegan package point colour素食包点颜色
【发布时间】: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'

【问题讨论】:

    标签: r plot vegan mds


    【解决方案1】:

    monoMDS 没有points() 方法。有人懒得写...

    你可以使用

     points(scores(xcMDS), col = cols, pch = 16)
    

    对给您带来的不便深表歉意。

    【讨论】:

    • 非常感谢 Jari Oksanen
    • vegan 的 github 存储库现在有 pointstext for monoMDS。应该出现在素食主义者的未来版本中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-09
    • 1970-01-01
    • 2016-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-11
    相关资源
    最近更新 更多