ecos_blocks: Ecological Block Struture plot with ggplot2 package

Description Usage Arguments Value Examples

View source: R/ecos_blocks.R

Description

Make a Structure Plot split into ecological blocks by a blocker metadata and ordered in each block by an ordering metadata

Usage

1
2
3
4
5
6
7
8
9
ecos_blocks(
  omega,
  blocker_metadata,
  order_metadata,
  palette = c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00",
    "#CC79A7"),
  structure_control = list(),
  layout
)

Arguments

omega

Matrix of Cluster membership probabilities of each sample obtained from ecos_fit(). The row sums sum to 1 for each sample.

blocker_metadata

a factor metadata used for creating blocks of Structure plots.

order_metadata

A quantitative metadata used for ordering sites in each block.

palette

A vector of colors assigned to the clusters. First color in the vector is assigned to the cluster labeled as 1, and second color in the vector is assigned to the cluster labeled as 2, etc. The number of colors must be the same or greater than the number of clusters. The recommended choice of color palette here is RColorBrewer, for instance RColorBrewer::brewer.pal(8, "Accent") or RColorBrewwer::brewer.pal(9, "Set1").

structure_control

Control parameters for the Block Structure plot. Fixes the title, axis labels, tick sizes, splitting line characteristics and panel orientation.

layout

The graph layout for plotting the Block Structure output. Is missing, automatically determined as a square configuration.

Value

Plots the Block Structure plot visualization of the GoM model

Examples

1
2
3
4
5
6
7
8
9
data("himalayan_birds")
species_abundance_counts <- t(exprs(himalayan_birds));
site_metadata <- pData(himalayan_birds);
elevation_metadata=site_metadata$Elevation;
east_west_dir = site_metadata$WorE;
topic_clus <- ecos_fit(species_abundance_counts, K = 2, tol = 0.1)
ecos_blocks(topic_clus$omega,
            blocker_metadata = east_west_dir,
            order_metadata = elevation_metadata)

kkdey/ecostructure documentation built on Jan. 26, 2021, 4:10 p.m.