vegan package specaccum - colSums(x)出错:'x'必须是数字

时间:2018-05-16 01:00:40

标签: r vegan

我正在尝试使用分类法文件使用包vegan和函数specaccum运行物种曲线,但我一直收到错误:

Error in colSums(x) : 'x' must be numeric

此文件是一个巨大的表格,第一列中有物种分类,下一页中有站点。像这样:

sum.taxonomy | K0024.A2.S1.L001.x | K0024.B2.S9.L001.x
Acantharea;Arthracanthida;Acanthometridae;Acanthometra; | 0 | 57
Acantharea;Chaunacanthida;NA;; | 3 | 0

每个值都是与读取次数相对应的数字。我尝试过以多种方式上传此文件,我查找了缺失的值,我尝试强制使用表as.numeric但仍未成功。

这是我认为可行的命令:

    table <- read.table("All_reads_all_markers_all_samples_after_decontamination.txt", 
             header = TRUE, sep = "\t",  quote = "", comment.char = "", 
             row.names = 1, stringsAsFactors = F)
    specaccum(table, method = "rarefaction")

我不知道我在这里缺少什么。任何帮助将不胜感激!

我在Windows 10中使用RStudio v1.1.383,R v3.5.0和vegan v2.5.1。

0 个答案:

没有答案