plot: Plot Compositional Data

plotR Documentation

Plot Compositional Data

Description

Displays a matrix of ternary plots.

Usage

## S4 method for signature 'CompositionMatrix,missing'
plot(
  x,
  ...,
  by = groups(x),
  margin = NULL,
  color = palette_color_discrete(),
  symbol = palette_shape()
)

Arguments

x

A CompositionMatrix object.

...

Further graphical parameters.

by

A vector of grouping elements, as long as the variables in x.

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).

color

A palette function that when called with a single argument returns a character vector of colors.

symbol

A palette function that when called with a single argument returns a vector of symbols.

Value

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

Author(s)

N. Frerebeau

See Also

isopleuros::ternary_pairs(), isopleuros::ternary_plot()

Other plot methods: as_graph(), barplot(), hist(), plot_logratio

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
plot(coda)

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

nexus documentation built on Sept. 11, 2024, 6:43 p.m.