balance.plot: Calculate and Visualize Balances

Description Usage Arguments Value Author(s) Examples

View source: R/balance.plot.R

Description

This function calculates balances based on the compositional data set and serial binary partition (SBP) matrix provided, then generates a figure from the results.

Usage

1
2
balance.plot(x, y, d.group, n.group, boxplot.split = TRUE,
  weigh.var = FALSE, size.text = 20, size.pt = 4)

Arguments

x

A matrix with rows as samples (N) and columns as components (D).

y

A serial binary partition matrix with rows as components (D) and columns as balances (D-1).

d.group

A vector of group labels for components. Optional. If provided, used to color component points.

n.group

A vector of group labels for samples. Optional. If provided, used to color sample points.

boxplot.split

A boolean. Toggles whether to split the boxplot by n.group. TRUE better resembles balance dendrogram style.

weigh.var

A boolean. Toggles whether to weigh line width by the proportion of explained variance. Only do this if balances come from an SBP that decomposes variance.

size.text

An integer. Sets legend text size.

size.pt

An integer. Sets point size.

Value

A list of the "partition" ggplot object, the "distribution" ggplot object, and the per-sample balances.

Author(s)

Thom Quinn

Examples

1
2
3
4
5
library(balance)
data(iris)
x <- iris[,1:4]
sbp <- sbp.fromPBA(x)
balance(x, sbp)

balance documentation built on July 10, 2019, 9:03 a.m.