<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Ternary plot with a partition in classes (levels of a factor)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://rpkg.net/assets/examples.css" />
</head><body>

<table width="100%" summary="page for triangle.class"><tr><td>triangle.class</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Ternary plot with a partition in classes (levels of a factor)</h2>

<h3>Description</h3>

<p>This function represents a three dimensional scatter plot with a partition in classes (levels of a factor).
</p>


<h3>Usage</h3>

<pre>
triangle.class(dfxyz, fac, wt = rep(1, NROW(fac)), labels = levels(fac), 
  col = NULL, ellipseSize = 1, starSize = 1, chullSize = NULL, adjust = TRUE, 
  min3d = NULL, max3d = NULL, showposition = TRUE, facets = NULL, plot = TRUE, 
  storeData = TRUE, add = FALSE, pos = -1, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>dfxyz</code></td>
<td>
<p>a three columns data frame used to produce the plot</p>
</td></tr>
<tr valign="top"><td><code>fac</code></td>
<td>
<p>a factor (or a matrix of factors) splitting the rows of <code>dfxyz</code></p>
</td></tr>
<tr valign="top"><td><code>wt</code></td>
<td>
<p>a vector of weights for <code>fac</code></p>
</td></tr>
<tr valign="top"><td><code>labels</code></td>
<td>
<p>a character vector containing the class' labels</p>
</td></tr>
<tr valign="top"><td><code>col</code></td>
<td>
<p>a logical, a color or a colors vector to color points, ellipses, labels, lines and polygons</p>
</td></tr>
<tr valign="top"><td><code>ellipseSize</code></td>
<td>
<p>a positive number for ellipse size</p>
</td></tr>
<tr valign="top"><td><code>starSize</code></td>
<td>
<p>a number between 0 and 1 for the size of the stars segments joining the stars' center 
(centroids) and the matching points</p>
</td></tr>
<tr valign="top"><td><code>chullSize</code></td>
<td>
<p><code>NULL</code> or a vector of numbers between 0 and 1 for the fraction of points included in the convex hull</p>
</td></tr>
<tr valign="top"><td><code>adjust</code></td>
<td>
<p>a logical to adjust the device with the limits of the smaller equilateral triangle containing the values</p>
</td></tr>
<tr valign="top"><td><code>min3d</code></td>
<td>
<p>a vector of three values for triangular minimal limits</p>
</td></tr>
<tr valign="top"><td><code>max3d</code></td>
<td>
<p>a vector of three values for triangular maximal limits</p>
</td></tr>
<tr valign="top"><td><code>showposition</code></td>
<td>
<p>a logical indicating whether the used triangle should be shown in the complete one</p>
</td></tr>
<tr valign="top"><td><code>facets</code></td>
<td>
<p>a factor splitting the rows of <code>dfxyz</code> so that subsets
of the data are represented on different sub-graphics</p>
</td></tr>
<tr valign="top"><td><code>plot</code></td>
<td>
<p>a logical indicating if the graphics is displayed</p>
</td></tr>
<tr valign="top"><td><code>storeData</code></td>
<td>
<p>a logical indicating if the data are stored in
the returned object. If <code>FALSE</code>, only the names of the data
arguments are stored</p>
</td></tr>
<tr valign="top"><td><code>add</code></td>
<td>
<p>a logical. If <code>TRUE</code>, the graphic is superposed to the graphics
already plotted in the current device</p>
</td></tr>
<tr valign="top"><td><code>pos</code></td>
<td>
<p>an integer indicating the position of the
environment where the data are stored, relative to the environment
where the function is called. Useful only if <code>storeData</code> is
<code>FALSE</code></p>
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
<p>additional graphical parameters (see
<code>adegpar</code> and <code>trellis.par.get</code>)</p>
</td></tr>
</table>


<h3>Value</h3>

<p>An object of class <code>ADEg</code> (subclass <code>Tr.class</code>) or <code>ADEgS</code> (if <code>showposition</code> is TRUE, 
if <code>add</code> is <code>TRUE</code> and/or if facets are used).<br />
The result is displayed if <code>plot</code> is <code>TRUE</code>.
</p>


<h3>Author(s)</h3>

<p>Alice Julien-Laferriere, Aurelie Siberchicot <a href="mailto:aurelie.siberchicot@univ-lyon1.fr">aurelie.siberchicot@univ-lyon1.fr</a> and Stephane Dray
</p>


<h3>See Also</h3>

<p><code>Tr.class</code>
<code>ADEg.Tr</code>
</p>


<h3>Examples</h3>

<pre>
data(euro123, package = "ade4")
fac1 &lt;- euro123$plan$an
df1 &lt;- rbind.data.frame(euro123$in78, euro123$in86, euro123$in97)
triangle.class(df1, fac = fac1, showposition = TRUE, col = c(1, 2, 3))
triangle.class(df1, fac = fac1, showposition = FALSE, plabels.cex = 0, col = c(1, 2, 3), 
  key = list(space = "left"))
</pre>


</body></html>
