我正在尝试使用分类法文件使用包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。