Displaying compositions in ternary diagrams
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  ## S3 method for class 'acomp'
plot(x,...,labels=names(x),
aspanel=FALSE,id=FALSE,idlabs=NULL,idcol=2,center=FALSE,
scale=FALSE,pca=FALSE,col.pca=par("col"),margin="acomp",
add=FALSE,triangle=!add,col=par("col"),axes=FALSE,
plotMissings=TRUE,
lenMissingTck=0.05,colMissingTck="red",
mp=~simpleMissingSubplot(c(0,1,0.95,1),
missingInfo,c("NM","TM",cn)),
robust=getOption("robust"))
## S3 method for class 'rcomp'
plot(x,...,labels=names(x),
aspanel=FALSE,id=FALSE,idlabs=NULL,idcol=2,center=FALSE,
scale=FALSE,pca=FALSE,col.pca=par("col"),margin="rcomp",
add=FALSE,triangle=!add,col=par("col"),axes=FALSE
,plotMissings=TRUE,
lenMissingTck=0.05,colMissingTck="red",
mp=~simpleMissingSubplot(c(0,1,0.95,1),
missingInfo,c("NM","TM",cn)),
robust=getOption("robust"))
## S3 method for class 'ccomp'
plot(x,...)

x 
a dataset of a compositional class 
... 
further graphical parameters passed (see

margin 
the type of marginalisation to be computed, when
displaying the individual panels. Possible values are: 
add 
a logical indicating whether the information should just be added to an existing plot. If FALSE a new plot is created 
triangle 
a logical indicating whether the triangle should be drawn 
col 
the color to plot the data 
labels 
the names of the parts 
aspanel 
logical indicating that only a single panel should be drawn and not the whole plot. Internal use only 
id 
logical, if TRUE one can identify the points like with the

idlabs 
a character vector providing the labels to be used with
the identification, when 
idcol 
color of the 
center 
a logical indicating whether a the data should be
centered prior to the plot. Centering is done in the choosen
geometry. See 
scale 
a logical indicating whether a the data should be
scaled prior to the plot. Scaling is done in the choosen
geometry. See 
pca 
a logical indicating whether the first principal component should be displayed in the plot. Currently, the direction of the principal component of the displayed subcomposition is displayed as a line. In a future, the projected principal componenent of the whole dataset should be displayed. 
col.pca 
The color to draw the principal component. 
axes 
Either a logical wether to plot the axes, or numerical enumerating the axes sides to be used e.g. 1 for only plotting the lower axes, or a list of parameters to ternaryAxis. 
plotMissings 
logical indicating that missingness should be
represented graphically. Componentes with one missing subcomponent
in the plot are represented by tickmarks at the three
axis. Components with two or three missing components are only
represented in a special panel drawn according to the mp parameter
if missings are present. Missings of type BDL (below detection
limit) are always plotted, even if 
lenMissingTck 
length of the tickmarks to be plotted for missing values. If 0 no tickmarks are plotted. Negative lengths point outside. length 1 draws right through to the opposit corner. Missing ticks in acomp geometry are inclined showing the line of possible values in acomp geometry. Missingticks in rcompgeometry are vertical to the axis representing the fact that only the other component is unkown. That these lines can leave the plot is one of the odd consequences of rcomp geometry. 
colMissingTck 
colors to draw the missing tickmarks. NULL means to take the colors specified for the observations. 
mp 
A formula providing a call to a function plotting
informations on the missings. The call is evaluted in the
environment of the panel plotting function and has access (among
others) to: 
robust 
A robustness description. See robustnessInCompositions for details. The option is used for centering, scaling and principle components. 
The data is displayed in ternary diagrams. Thus, it does not work for
twopart compositions. Compositions of three parts are displayed
in a single ternary diagram. For compositions of more than three
components, the data is arranged in a scatterplot matrix through the
command pairs
.
In this case, the third component in each of the panels is chosen
according to setting of margin=
. Possible values of margin=
are:
"acomp"
, "rcomp"
and any of the variable names/column numbers in the
composition. If one of the columns is selected each panel displays a
subcomposition given by the row part, the column part and
the given part. If one of the classes is given the corresponding
margin acompmargin
or rcompmargin
is
used.
Ternary diagrams can be read in multiple ways. Each corner of the
triangle corresponds to an extreme composition containing only the part
displayed in that corner. Points on the edges correspond to
compositions containing only the parts in the adjacent corners. The
relative amounts are displayed by the distance to the opposite
corner (socalled barycentric coordinates). The individual portions
of any point can be infered by drawing a line through the investigated point,
and parallel to the edge opposite to the corner of the part of interest.
The portion of this part is constant along the line. Thus we can read it
on the sides of the ternary diagram, where the line crosses its borders.
Note that these isoPortionLines
remain straight under an
arbitrary perturbation.
ccomp ternary diagrams are always jittered to avoid overplotting.
K.Gerald v.d. Boogaart http://www.stat.boogaart.de, Raimon TolosanaDelgado
Aitchison, J. (1986) The Statistical Analysis of Compositional
Data Monographs on Statistics and Applied Probability. Chapman &
Hall Ltd., London (UK). 416p.
Aitchison, J, C. Barcel'oVidal, J.J. Egozcue, V. PawlowskyGlahn
(2002) A consise guide to the algebraic geometric structure of the
simplex, the sample space for compositional data analysis, Terra
Nostra, Schriften der Alfred WegenerStiftung, 03/2003
Billheimer, D., P. Guttorp, W.F. and Fagan (2001) Statistical interpretation of species composition,
Journal of the American Statistical Association, 96 (456), 12051214
PawlowskyGlahn, V. and J.J. Egozcue (2001) Geometric approach to
statistical analysis on the simplex. SERRA 15(5), 384398
http://ima.udg.es/Activitats/CoDaWork03
http://ima.udg.es/Activitats/CoDaWork05
plot.aplus
, plot3D
(for 3D plot),
kingTetrahedron
(for 3Dplot model export),
qqnorm.acomp
,boxplot.acomp
1 2 3 4 5 6 7 8  data(SimulatedAmounts)
plot(acomp(sa.lognormals))
plot(acomp(sa.lognormals),axes=TRUE)
plot(rcomp(sa.lognormals))
plot(rcomp(sa.lognormals5))
plot(acomp(sa.lognormals5),pca=TRUE,col.pca="red")
plot(rcomp(sa.lognormals5),pca=TRUE,col.pca="red",axes=TRUE)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.