我正在尝试使用 vegan 包在 R 中对数据集执行 NMDS,该数据集以绘图为列,以物种计数为列。我的数据采用文本文件格式(制表符分隔),包含大量“0”物种计数。但是,当我尝试创建距离矩阵时,我收到以下错误消息:
bray <- vegdist(data1, method = "bray")
Warning messages: 1: In vegdist(data1, method = "bray") : you have empty rows: their dissimilarities may be meaningless in method “bray” 2: In vegdist(data1, method = "bray") : missing values in results
这会阻止我执行 NMDS:
nmds <- metaMDS(data1, k = 2,
+ distance = 'bray', autotransform = FALSE)
Error in if (any(dist < -sqrt(.Machine$double.eps))) warning("some dissimilarities are negative -- is this intentional?") : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In distfun(comm, method = distance, ...) : you have empty rows: their dissimilarities may be meaningless in method “bray” 2: In distfun(comm, method = distance, ...) : missing values in results
我该如何解决这个问题?
感谢您的回答!
最佳答案
某些列仅包含 0 个计数。删除这些就可以了
关于r - 使用包 vegdist 在 R 中执行 NMDS 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16638297/