order_taxa: Order Taxon Name Factors

View source: R/make_phy_df.R

order_taxaR Documentation

Order Taxon Name Factors

Description

order_taxa() reorders the taxon names in a taxon column (e.g. 'Class' or 'Phylum') by the taxon's mean abundance (but always makes sure to put Other first).

Usage

order_taxa(phy_df, rank, abund = "Abundance", decreasing = FALSE)

Arguments

phy_df

A data frame of a phyloseq object, as produced by phyloseq::psmelt() or make_phy_df().

rank

The name of the column to be re-ordered

abund

The name of the abundances column. Defaults to 'Abundance'

decreasing

Specifies whether the taxon order should be based on decreasing or increasing abundance. Defaults to FALSE.

Value

A data frame that is identical to the one given, but with the specified column re-ordered by its mean abundance


JCSzamosi/aftersl1p documentation built on July 3, 2025, 8:37 p.m.