I am trying to use a taxonomy file to run a species curve using the package vegan
and the function specaccum
, but I keep getting the error:
Error in colSums(x) : 'x' must be numeric
This file is a huge table, with species taxonomy in the first column, and sites in the next ones. Like this:
sum.taxonomy | K0024.A2.S1.L001.x | K0024.B2.S9.L001.x
Acantharea;Arthracanthida;Acanthometridae;Acanthometra; | 0 | 57
Acantharea;Chaunacanthida;NA;; | 3 | 0
Each value is a number corresponding to the number of reads. I've tried uploading this file in multiple ways, I've looked for missing values, I've tried forcing the table as.numeric
and still no success.
This is the command I thought would work:
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")
I don't know what I'm missing here. Any help would be greatly appreciated!
I'm using RStudio v1.1.383, R v3.5.0, and vegan v2.5.1 in a Windows 10.