This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to fix Error in `$<-.data.frame`(`*tmp*`, "Kingdom", value = character(0)) : replacement has 0 rows, data has 2407

Hi all, I am stuck with this error.

Error in `$<-.data.frame`(`*tmp*`, "Kingdom", value = character(0)) : 
  replacement has 0 rows, data has 2407

This is what I get after running this command

amp_rabund(data = physeqP,
           tax.aggregate = "Genus",
           tax.add = "Phylum",
           scale.seq = 100)

This is how my phyloseq object (data) looks like

> physeqP
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 2407 taxa and 73 samples ]
sample_data() Sample Data:       [ 73 samples by 3 sample variables ]
tax_table()   Taxonomy Table:    [ 2407 taxa by 6 taxonomic ranks ]

I have tried to do it on data subset as well but it fails every time. I am not even able to understand what problem it is. The instructions i am following are given in this link

http://madsalbertsen.github.io/ampvis/examples/ampvis_guide.html

I would be very thankful if you please help me fix the issue... Thanks in advance Arslan

rank abundance phyloseq

You need to show the actual command producing this error and some context surrounding it.

Apologies. Here is the command.

amp_rabund(data = dsn,
           tax.aggregate = "Genus",
           tax.add = "Phylum",
           scale.seq = 100)

1 answer

The new version ampvis2 worked perfectly. Thanks!

Log in to answer this question.