Skip to contents

Displays a matrix of ternary plots.

Usage

# S4 method for class 'CompositionMatrix'
pairs(x, margin = NULL, ...)

# S4 method for class 'GroupedComposition'
pairs(x, ..., margin = NULL, color = NULL, symbol = NULL)

Arguments

x

A CompositionMatrix object.

margin

A character string or an integer giving the index of the column to be used as the third part of the ternary plots. If NULL (the default), marginal compositions will be used (i.e. the geometric mean of the non-selected parts).

...

Further graphical parameters.

color

A (named) vector of colors (will be mapped to the group names of object) or a function that when called with a single argument (an integer specifying the number of colors) returns a vector of colors.

symbol

A (named) vector of colors (will be mapped to the group names of object).

Value

plot() is called for its side-effects: is results in a graphic being displayed (invisibly return x).

Author

N. Frerebeau

Examples

## Data from Day et al. 2011
data("kommos", package = "folio") # Coerce to compositional data
kommos <- remove_NA(kommos, margin = 1) # Remove cases with missing values
coda <- as_composition(kommos, parts = 3:8, groups = 1)

## Use ceramic types for grouping
pairs(coda)


## Center and scale ternary plots
pairs(coda, by = NULL, center = TRUE, scale = TRUE)