subset_order: Subset and generate taxon ordering

View source: R/prep_plot_rank_ab.R

subset_orderR Documentation

Subset and generate taxon ordering

Description

subset_order generates a data frame whose taxon column given by rank has been ranked according to its mean abundance in the abunds column. Used internally by rank_abund()

Usage

subset_order(
  phy_df,
  varbs = NULL,
  bases = NULL,
  rank = "Genus",
  abunds = "TotalAbunds"
)

Arguments

phy_df

A phyloseq data frame, as generated by phyloseq::psmelt(), but probably generated by df_glom() or make_phy_df().

varbs

(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 vars. 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 varbs.

rank

('Genus') The taxonomic rank to base the ordering on.

abund

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


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