library(rbiom)
    library(ggplot2)
    
    sample_sums(hmp50, sort = 'asc') %>% head()
    
    # Unique OTUs and "cultured" classes per sample
    nnz <- function (x) sum(x > 0) # number of non-zeroes
    sample_apply(hmp50, nnz, 'otu') %>% head()
    sample_apply(hmp50, nnz, 'class', unc = 'drop') %>% head()
    
    # Number of reads in each sample's most abundant family
    sample_apply(hmp50, base::max, 'f', sort = 'desc') %>% head()
    
    ggplot() + geom_histogram(aes(x=sample_sums(hmp50)), bins = 20)
Run the code above in your browser using DataLab