PCplot: PCplot:Scatter plot of community compositions colored by...

View source: R/visualization.R

PCplotR Documentation

PCplot:Scatter plot of community compositions colored by basin label

Description

Performs PCA on the community composition matrix (ocmat) and plots the first two PCs. Points are colored by the stable state (basin) label estimated from Bi. If pruned = TRUE, colors correspond to the pruned/merged basin labels in ssrep (stablestates2), otherwise to the original labels (stablestates). When export = TRUE, the plotting data frame (stable-state labels + PCs + merged labels) is returned.

Usage

PCplot(ocmat, sa = sa, env = NULL, ssrep = NULL, pruned = TRUE, export = FALSE)

Arguments

ocmat

Data frame (or matrix) of community compositions (rows = samples, columns = species/features).

sa

Parameter set passed to sa2params.

env

Optional environment object passed to sa2params.

ssrep

Data frame-like object providing stable state label mapping with two columns: stablestates and stablestates2.

pruned

Logical; if TRUE, use stablestates2 for coloring.

export

Logical; if TRUE, return the data used for plotting.

Value

NULL invisibly (or a data frame when export = TRUE).


ELAplus documentation built on May 28, 2026, 5:09 p.m.