rank_abund: Rank Taxa by Abundance

View source: R/prep_plot_rank_ab.R

rank_abundR Documentation

Rank Taxa by Abundance

Description

rank_abund() generates a data frame that's ready to be used by plot_rank_ab()

Usage

rank_abund(
  phy_df,
  gvars = NULL,
  bases = NULL,
  abunds = "Abundance",
  rank = "Genus",
  IDcol
)

Arguments

phy_df

A dataframe of a phyloseq object, like that generated by phyloseq::psmelt() or make_phy_df()

gvars

(NULL) A character vector of grouping variables from which the baseline values are chosen to define the abundance ordering. If it is NULL, the ordering will be based on mean abundances in the whole data frame.

bases

(NULL) A character vector of baseline values for the variables given in gvars. The ordering of the taxa will be given based only on the samples with these baseline values for these variables. Must be in the same order as gvars.

abunds

('Abundance') The name of the abundance column.

rank

('Genus') The rank to base the ordering on. Must be a column in phy_df

IDcol

('X.SampleID') The column name of the sample IDs

Value

A data frame whose taxa have been ranked by their mean abundance in the user-specified baseline level of some grouping variable or variables.


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