NAs in otu_table are not handled informatively by ps_counts and any functions that call ps_counts, e.g. comp_barplot
Instead, an uninformative error is thrown.
library(phyloseq)
library(microViz)
#> microViz version 0.10.7 - Copyright (C) 2022 David Barnett
#> ! Website: https://david-barnett.github.io/microViz
#> ✔ Useful? For citation details, run: `citation("microViz")`
#> ✖ Silence? `suppressPackageStartupMessages(library(microViz))`
data("GlobalPatterns")
GlobalPatterns %>% tax_fix() %>% comp_barplot("Class")
#> Registered S3 method overwritten by 'seriation':
#> method from
#> reorder.hclust vegan
GlobalPatterns@otu_table[GlobalPatterns@otu_table == 0] <- NA
GlobalPatterns %>% tax_fix() %>% comp_barplot("Class")
#> Error in if (any(test_matrix < 1 & test_matrix != 0)) {: missing value where TRUE/FALSE needed
NAs in otu_table are not handled informatively by ps_counts and any functions that call ps_counts, e.g. comp_barplot Instead, an uninformative error is thrown.
Created on 2023-03-08 with reprex v2.0.2