Thanks for your answer, so x is the taxa file?
Error input data must be numeric in R, how to solve it?
Error input data must be numeric, how to solve it?
I am trying to perform Alpha diversity for microbiome analysis in R, I got an error when ASV file is the input data although it has numeric values:
Error in diversity(ASV, index = "shannon") : input data must be numeric
• 4,694 views
•
link
1 answer
I am guessing you are using microbiome::diversity function in the Bioconductor microbiome package. The help page for the function says:
Usage
diversity(x, index = "all", zeroes = TRUE)
Arguments
xA species abundance vector, or matrix (taxa/features x samples) with the absolute count data (no relative abundances), or phyloseq-class objectindexDiversity index. See details for options.zeroesInclude zero counts in the diversity estimation.
So it is clear that you need to give the function a numeric vector or matrix, not a data.frame or csv file.
• 0 views
•
link
Log in to answer this question.
What is the package you're trying to use here? What does your data look like? It is an
Excelfile? Is it aCSVfile? Or has this "ASV" data been loaded into the environment already?The data is text file (I opened it as csv to show you) and it looks like that