Skip to contents

Visualize how many variables are linked to each tree rank or tree type.

Usage

plot_tree_link(
  object,
  tree = c("otu_tree", "taxa_tree"),
  x = c("link_rank", "tree")
)

Arguments

object

A microbiome_dataset object.

tree

Tree slot, either "otu_tree" or "taxa_tree".

x

Variable used on the x-axis. Defaults to "link_rank".

Value

A ggplot object.

Examples

data("global_patterns", package = "microbiomedataset")

x <- prune_taxa(global_patterns, variable_id = global_patterns@variable_info$variable_id[1:120])
x <- microbiomedataset::convert2microbiome_dataset(
  microbiomedataset::convert2phyloseq(x)
)
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
p <- plot_tree_link(x, tree = "taxa_tree")
class(p)
#> [1] "ggplot2::ggplot" "ggplot"          "ggplot2::gg"     "S7_object"      
#> [5] "gg"