Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

isopleuros (version 1.4.0)

coordinates_ternary: Ternary Coordinates

Description

Computes ternary coordinates.

Usage

coordinates_ternary(x, y, z, ...)

# S4 method for numeric,numeric,numeric coordinates_ternary( x, y, z, center = FALSE, scale = FALSE, missing = getOption("isopleuros.missing") )

# S4 method for ANY,missing,missing coordinates_ternary( x, xlab = NULL, ylab = NULL, zlab = NULL, center = FALSE, scale = FALSE, missing = getOption("isopleuros.missing") )

Value

A list with the components:

xA numeric vector of x coordinates.
yA numeric vector of y coordinates.
centerA numeric vector giving the center.
scaleA numeric vector giving the scale factor.

Arguments

x, y, z

A numeric vector giving the x, y and z cartesian coordinates of a set of points. If y and z are missing, an attempt is made to interpret x in a suitable way (see grDevices::xyz.coords()).

...

Currently not used.

center

A logical scalar or a numeric vector giving the center.

scale

A logical scalar or a length-one numeric vector giving a scaling factor.

missing

A logical scalar: should missing values be replaced with zeros before the computation proceeds? If FALSE (the default), incomplete cases are removed.

xlab, ylab, zlab

A character string specifying the names for the x, y and z variables to be extracted.

Author

N. Frerebeau

See Also

Other coordinates: coordinates_cartesian()

Examples

Run this code
## Compositional data
coda <- data.frame(
  x = c(1, 0, 0, 1/3),
  y = c(0, 1, 0, 1/3),
  z = c(0, 0, 1, 1/3)
)

## Ternary coordinates
(tern <- coordinates_ternary(coda))

## Cartesian coordinates
(cart <- coordinates_cartesian(tern))

Run the code above in your browser using DataLab