Error in 1:nrow(SM) : argument of length 0

Good day everyone

I am really struggling to get my metadata file in Rstudio for analysis. The import of the file is working perfectly fine, however, the moment I am trying to generate a phyloseq object this is the error I am getting: Error in 1:nrow(SM): argument of length 0.

My code:

# This is to import the file into Rstudio
metadata_ASV = read.table(file.choose(), header = TRUE, row.names = 1, sep = "\t")

I then check the form of the file

class(metadata_ASV)

The command below is the one I am using to generate the phyloseq object. This command did work previously but suddenly it is not working anymore.

ASV_sampledata = sample_data(metadata_ASV)

Any insight into what is causing the error:

Error in 1:nrow(SM): argument of length 0

Thank you in advance for any help on this.

Regards Sunette

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. Much easier to give answers if the problem doesn't have to be reverse engineered.

I'd expect to see an a message like this is the SM object were missing, possibly, or were not a data frame.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.