r - ANOSIM Error Vegan Package R - “if (xi > xj) 1L else -1L 中的错误:需要 TRUE/FALSE 的地方缺少值”
问题描述
我正在尝试使用两个分组变量完成物种存在数据的 ANOSIM 这是数据框的示例(原始数据框有 50 列):
print(rec.ano.wide[1:5])
# Groups: cyclone_time [2]
cyclone_time acanthastrea acropora astreopora blastomussa
<fct> <dbl> <dbl> <dbl> <dbl>
1 before 15 119 21 3
2 after 10 154 6 1
我使用以下代码执行 anosim 分析:
#get the grouping variable
group <- rec.ano.wide[, "cyclone_time"]
#create community matrix
rec.com <- rec.ano.wide[,2:ncol(rec.ano.wide)]
rec.matrix = as.matrix(rec.com)
#anosim analysis
rec.ano = anosim(rec.matrix, group, distance = "bray", permutations = 9999)
该分析给出了这个错误
Error in if (xi > xj) 1L else -1L : missing value where TRUE/FALSE needed
In addition: Warning message:
In Ops.factor(xi, xj) : ‘>’ not meaningful for factors
我不知道这意味着什么,所以任何帮助将不胜感激!!
解决方案
推荐阅读
- javascript - 'getDownloadURL' 在 Promise 中返回少一个 URL
- c - 如何将字符串传递给函数,然后检查它是否等于字符串
- python - 表未创建
- android - (android) 如何在 Recyclerview 中选择 singleItem?
- raku - commaide 在分析文件时被 OOM 杀死
- r - 在 dplyr 中,在过滤行名后进行汇总时未显示
- javascript - 子节点中的值被覆盖的firebase
- html - Flexbox 向右浮动 div
- docker - 无法使用 Docker 连接到 Mysql
- java - MVC 控制器通信