Learn R Programming

compositions (version 1.40-2)

idt: Isometric default transform

Description

Compute the isometric default transform of a vector (or dataset) of compositions or amounts in the selected class.

Usage

idt(x,...)
          # S3 method for default
idt( x,... )
          # S3 method for acomp
idt( x ,...)
          # S3 method for rcomp
idt( x ,...)
          # S3 method for aplus
idt( x ,...)
          # S3 method for rplus
idt( x ,...)
          # S3 method for rmult
idt( x ,...)
          # S3 method for ccomp
idt( x ,...)
          # S3 method for factor
idt( x ,...)
          idtInv(x,orig,...)
          # S3 method for default
idtInv( x ,orig,...)
          # S3 method for acomp
idtInv( x ,orig,...)
          # S3 method for rcomp
idtInv( x ,orig,...)
          # S3 method for aplus
idtInv( x ,orig,...)
          # S3 method for rplus
idtInv( x ,orig,...)
          # S3 method for ccomp
idtInv( x ,orig,...)
          # S3 method for rmult
idtInv( x ,orig,...)

Arguments

x

a classed amount or composition, to be transformed with its isometric default transform, or its inverse

generic arguments past to underlying functions

orig

a compositional object which should be mimicked by the inverse transformation. It is used to determine the backtransform to be used, and eventually to reconstruct the names of the parts. It is the generic argument. Typically the orig-argument is the dataset that has been transformed in the first place.

Value

A corresponding matrix of row-vectors containing the transforms.

Details

The general idea of this package is to analyse the same data with different geometric concepts, in a fashion as similar as possible. For each of the four concepts there exists an isometric transform expressing the geometry in a full-rank euclidean vector space. Such a transformation is computed by idt. For acomp the transform is ilr, for rcomp it is ipt, for aplus it is ilt, and for rplus it is iit. Keep in mind that the transform does not keep the variable names, since there is no guaranteed one-to-one relation between the original parts and each transformed variable.

The inverse idtInv is intended to allow for an "easy" and automatic back-transformation, without intervention of the user. The argument orig (the one determining the behaviour of idtInv as a generic function) tells the function which back-transformation should be applied, and gives the column names of orig to the back-transformed values of x. Therefore, it is very conventient to give the original classed data set used in the analysis as orig.

References

van den Boogaart, K.G. and R. Tolosana-Delgado (2008) "compositions": a unified R package to analyze Compositional Data, Computers & Geosciences, 34 (4), pages 320-338, doi:10.1016/j.cageo.2006.11.017.

See Also

cdt, ilr, ipt, ilt, cdtInv, ilrInv, iptInv, iltInv, iitInv

Examples

Run this code
# NOT RUN {
# the idt is defined by
idt         <- function(x) UseMethod("idt",x)
idt.default <- function(x) x
idt.acomp   <- function(x) ilr(x) 
idt.rcomp   <- function(x) ipt(x) 
idt.aplus   <- ilt 
idt.rplus   <- iit 
# }
# NOT RUN {
idt(acomp(1:5))
idt(rcomp(1:5))
  data(Hydrochem)
  x = Hydrochem[,c("Na","K","Mg","Ca")]
  y = acomp(x)
  z = idt(y)
  y2 = idtInv(z,y)
  par(mfrow=c(2,2))
  for(i in 1:4){plot(y[,i],y2[,i])}
# }

Run the code above in your browser using DataLab