Learn R Programming

compositions (version 2.0-9)

Compositional Data Analysis

Description

Provides functions for the consistent analysis of compositional data (e.g. portions of substances) and positive numbers (e.g. concentrations) in the way proposed by J. Aitchison and V. Pawlowsky-Glahn.

Copy Link

Version

Install

install.packages('compositions')

Monthly Downloads

10,007

Version

2.0-9

License

GPL (>= 2)

Maintainer

K Gerald van den Boogaart

Last Published

August 21st, 2025

Functions in compositions (2.0-9)

Firework

Firework mixtures
DiagnosticProb

Diagnostic probabilities
HotellingsTsq

Hotellings T square distribution
Glacial

Compositions and total pebble counts of 92 glacial tills
Coxite

Compositions, depths and porosities of 25 specimens of coxite
HouseholdExp

Household Expenditures
Hydrochem

Hydrochemical composition data set of Llobregat river basin water (NE Spain)
Hongite

Compositions of 25 specimens of hongite
CompLinModCoReg

Compositional Linear Model of Coregionalisation
ConfRadius

Helper to compute confidence ellipsoids
Sediments

Proportions of sand, silt and clay in sediments specimens
Metabolites

Steroid metabolite patterns in adults and children
PogoJump

Honk Kong Pogo-Jumps Championship
SkyeAFM

AFM compositions of 23 aphyric Skye lavas
SerumProtein

Serum Protein compositions of blood samples
Skulls

Measurement of skulls
R2

R square
Kongite

Compositions of 25 specimens of kongite
ShiftOperators

Shifts of machine operators
SimulatedAmounts

Simulated amount datasets
acomparith

Power transform in the simplex
Supervisor

Proportions of supervisor's statements assigned to different categories
WhiteCells

White-cell composition of 30 blood samples by two different methods
acompmargin

Marginal compositions in Aitchison Compositions
acomp-class

Class "acomp"
Yatquat

Yatquat fruit evaluation
acomp

Aitchison compositions
amounts-class

Class "amounts"
alr

Additive log ratio transform
aplus-class

Class "aplus"
arrows3D

arrows in 3D, based on package rgl
binary

Treating binary and g-adic numbers
barplot.acomp

Bar charts of amounts
aplus

Amounts analysed in log-scale
axis3D

Drawing a 3D coordiante system to a plot, based on package rgl
aplusarithm

vectorial arithmetic for data sets with aplus class
balance

Compute balances for a compositional dataset.
cdt

Centered default transform
clr2ilr

Convert between clr and ilr, and between cpt and ipt.
apt

Additive planar transform
backtransform

Automatic common backtransformation for compositions
ccomp

Count compositions
as.data.frame

Convert "compositions" classes to data frames or matrices
biplot3D

Three-dimensional biplots, based on package rgl
ClusterFinder1

Heuristics to find subpopulations of outliers
boxplot

Displaying compositions and amounts with box-plots
clo

Closure of a composition
clr

Centered log ratio transform
ccomp-class

Class "ccomp"
ccompgof

Compositional Goodness of fit test
compositional-class

Class "compositional"
coloredBiplot

A biplot providing somewhat easier access to details of the plot.
colorsForOutliers

Create a color/char palette or for groups of outliers
cpt

Centered planar transform
CoDaDendrogram

Dendrogram representation of acomp or rcomp objects
compositions-package

tools:::Rd_package_title("compositions")
missing.compositions

The policy of treatment of missing values in the "compositions" package
compOKriging

Compositional Ordinary Kriging
dist

Distances in variouse approaches
cor.acomp

Correlations of amounts and compositions
endmemberCoordinates

Recast amounts as mixtures of end-members
ellipses

Draw ellipses
gausstest

Classical Gauss Test
fitSameMeanDifferentVarianceModel

Fit Same Mean Different Variance Model
groupparts

Group amounts of parts
gsiinternal1

Internal functions of the compositions package
gsicall

Internal functions of the compositions package
gsi.isSingleRow

Internal function: Can something be considered as a single multivariate data item?
gsi.drop

Internal functions: A conditional drop
gsiCoorInfo

Internal functions of the compositions package
fitdirichlet

Fitting a Dirichlet distribution
gsi.diagGenerate

Internal functions: Generate a diagonal matrix
gsi.expandrcomp

Internal function: Scaling rcomp
gof

Compositional Goodness of fit test
gsi.margin

Internal function: Compute a desired compositional margin
gsi.getD

Interal function: Get number of samples and number of parts in a compositional object
gsiinternal

Environment containing the old gsi functions
gsi.diagExtract

Internal functions: Get the diagonal of a matrix
gsigetBalStruct

An auxiliary functions to compute user-defined ilr and ipt transforms.
gsi.mapin01

Internal functions: Storing integers as reals
gsi.PrinBal

The canonical basis in the clr plane used for ilr and ipt transforms.
gsi.merge2signary

Auxiliary functions to compute user-defined ilr and ipt transforms.
geometricmean

The geometric mean
gsi.add

Internal functions: Parallel operations of single and multiple datasets
getdetectionlimit

Gets the detection limit stored in the data set
gsifiltercall

Calling from a function with the own parameters
gsi2.invperm

Internal function: Invert a permutation
gsi.csum

Internal function: row and column sums of matrices
gsi.addclass

Internal function: give a derived subclass to an object
gsi.eq

Internal function: Checking equality of IEEE special numbers
gsi.simshape

Internal function: Reshape an object to the shape type of another
gsiinternal3

Internal functions of the compositions package
gsiinternal2

Internal functions of the compositions package
gsi.recode

Internal function: Recode missings with IEEE number and vice versa
gsi.plain

Internal function: Convert to plain vector or matrix
gsiplotmargin

Internal functions of the compositions package
gsireset3D

Internal functions of the compositions package
gsi.textpanel

Internal function: A panel displaying a label only
gsipairs

Internal functions of the compositions package
gsi.svdsolve

Internal function: Solves singular and non square equation systems
ilrBase

The canonical basis in the clr plane used for ilr and ipt transforms.
gsi.varwithlosts

Internal function: computes variance of compositional data set with missing/zero values
ipt

Isometric planar transform
idt

Isometric default transform
IsMahalanobisOutlier

Checking for outliers
ilr

Isometric log ratio transform
iit

Isometric identity transform
is.acomp

Check for compositional data type
isoPortionLines

Isoportion- and Isoproportion-lines
ilt

Isometric log transform
lrvgram

vgram2lrvgram
kdeDirichlet

Density estimation on the simplex with Dirichlet kernel
mean.acomp

Mean amounts and mean compositions
jura

The jura dataset
kingTetrahedron

Ploting composition into rotable tetrahedron
acompscalarproduct

inner product for datasets with a vector space structure
matmult

inner product for matrices and vectors
MahalanobisDist

Compute Mahalanobis distances based von robust Estimations
logratioVariogram

Empirical variograms for compositions
lines

Draws connected lines from point to point.
transformations from 'mixtures' to 'compositions' classes

Transformations from 'mixtures' to 'compositions' classes
missingProjector

Returns a projector the the observed space in case of missings.
mix.Read

Reads a data file in a mixR format
oneOrDataset

Treating single compositions as one-row datasets
normalize

Normalize vectors to norm 1
meanrow

The arithmetic mean of rows or columns
missingsummary

Classify and summarize missing values in a dataset
norm

Vector space norm
mvar

Metric summary statistics of real, amount or compositional data
names

The names of the parts
outliersInCompositions

Analysing outliers in compositions.
outlierclassifier

Detect and classify compositional outliers.
plot3D

plot in 3D based on rgl
perturbe

Perturbation of compositions
outlierplot

Plot various graphics to analyse outliers.
parametricMat

Unique parametrisations for matrices.
pairwiseplot

Creates a paneled plot like pairs for two different datasets.
pairs

Pairs plot method for compositions
plot.acomp

Ternary diagrams
plot3Dacomp

3D-plot of compositional data
plotmissingsummary

Plot a Missing Summary
plotlogratioVariogram

Empirical variograms for compositions
plot3Drplus

plot in 3D based on rgl
powerofpsdmatrix

power transform of a matrix
plot3Drmult

plot in 3D based on rgl
plot.aplus

Displaying amounts in scatterplots
plot3Daplus

3D-plot of positive data
princomp.aplus

Principal component analysis for amounts in log geometry
princomp.rcomp

Principal component analysis for real compositions
princomp.acomp

Principal component analysis for Aitchison compositions
qqnorm

Normal quantile plots for compositions and amounts
rcomp-class

Class "rcomp"
ratioLoadings

Loadings of relations of two amounts
princomp.rplus

Principal component analysis for real amounts
princomp.rmult

Principal component analysis for real data
pwlr

Pairwise log ratio transform
rDirichlet

Dirichlet distribution
print.acomp

Printing compositional data.
rAitchison

Aitchison Distribution
pwlrPlot

Plots of pairwise logratio against a covariable.
rcompmargin

Marginal compositions in real geometry
rmultarithm

vectorial arithmetic for datasets in a classical vector scale
replot

Modify parameters of compositional plots.
rcomp

Compositions as elements of the simplex embedded in the D-dimensional real space
Read standard data files

Reads a data file in a geoeas format
rcomparithm

Arithmetic operations for compositions in a real geometry
rlnorm

The multivariate lognormal distribution
rmult

Simple treatment of real vectors
rMahalanobis

Compute distributions of empirical Mahalanobis distances based on simulations
rmult-class

Class "rmult"
runif

The uniform distribution on the simplex
rplus-class

Class "rplus"
rnorm

Normal distributions on special spaces
rplus

Amounts i.e. positive numbers analysed as objects of the real vector space
rmultmatmult

inner product for datasets with vector scale
scale

Normalizing datasets by centering and scaling
scalar

Parallel scalar products
rpois

Simulate count compositions without overdispersion
robustnessInCompositions

Handling robustness issues and outliers in compositions.
rplusarithm

vectorial arithmetic for data sets with rplus class
sumprojector

Compute the global projector to the observed subspace.
summary.rcomp

Summary of compositions in real geometry
simplemissingplot

Ternary diagrams
straight

Draws straight lines.
simulatemissings

Artifical simulation of various kinds of missings/polluted data
split

Splitting datasets in groups given by factors
segments

Draws straight lines from point to point.
summary.aplus

Summaries of amounts
subsetting

Subsetting of compositions
summary.acomp

Summarizing a compositional dataset in terms of ratios
ternaryAxis

Axis for ternary diagrams
NormalTests

Compositional Goodness of fit test
variograms

Variogram functions
ult

Uncentered log transform
vcovAcomp

Variance covariance matrix of parameters in compositional regression
variation

Variation matrices of amounts and compositions
var.acomp

Variances and covariances of amounts and compositions
varmlm

Residual variance of a model
totals

Total sum of amounts
tryDebugger

Empirical variograms for compositions
wrapped_functions

Standard R functions wrapped for compatibility
vgmFit

Compositional variogram model fitting
zeroreplace

Zero-replacement routine
ArcticLake

Artic lake sediment samples of different water depth
Activity10

Activity patterns of a statistician for 20 days
Blood23

Blood samples
Aar

Composition of glaciar sediments from the Aar massif (Switzerland)
Activity31

Activity patterns of a statistician for 20 days
Bayesite

Permeabilities of bayesite
ClamEast

Color-size compositions of 20 clam colonies from East Bay
ClamWest

Color-size compositions of 20 clam colonies from West Bay
Boxite

Compositions and depth of 25 specimens of boxite
AnimalVegetation

Animal and vegetation measurement