stacked_barchart: stacked_barchart stacked barchart of the top_n features in a...

View source: R/stacked_barchart.R

stacked_barchartR Documentation

stacked_barchart stacked barchart of the top_n features in a relative abundance table.

Description

stacked_barchart stacked barchart of the top_n features in a relative abundance table.

Usage

stacked_barchart(abundance_matrix, top_n = 10)

Arguments

abundance_matrix

dataframe; samples are columns and features are rows (relative abundance)

top_n

integer; number of taxa to plot in the stacked barchart. Default is 10.

Value

list

Examples

feature_count <- dss_example$merged_abundance_id %>%
tibble::column_to_rownames('featureID')

colnames(feature_count) <- paste0('id', colnames(feature_count))
feature_tax <- dss_example$merged_taxonomy
feature_count <- feature_count[feature_tax$featureID,]
aggregated_list <- aggregate_count(feature_count, feature_tax,
                                   aggregate_by = "Genus")

abundance_matrix <- relab(aggregated_list[['count_df']])
st <- stacked_barchart(abundance_matrix)
st$data
st$plot

OxfordCMS/OCMSutility documentation built on Feb. 27, 2025, 8:19 p.m.