<!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: 1-D plot of a numeric score partitioned in classes (levels of...</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 s1d.class"><tr><td>s1d.class</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>1-D plot of a numeric score partitioned in classes (levels of a factor)</h2>

<h3>Description</h3>

<p>This function represents the link between scores values and their matching labeled classes.
</p>


<h3>Usage</h3>

<pre>
s1d.class(score, fac, wt = rep(1, NROW(fac)), labels = levels(fac), at = 0.5, 
  poslabel = c("regular", "value"), col = NULL, facets = NULL, plot = TRUE, 
  storeData = TRUE, add = FALSE, pos = -1, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>score</code></td>
<td>
<p>a numeric vector (or a 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) to split <code>score</code></p>
</td></tr>
<tr valign="top"><td><code>wt</code></td>
<td>
<p>a vector of weights for <code>score</code></p>
</td></tr>
<tr valign="top"><td><code>labels</code></td>
<td>
<p>the labels' names drawn for each class</p>
</td></tr>
<tr valign="top"><td><code>at</code></td>
<td>
<p>a numeric vector used as an index</p>
</td></tr>
<tr valign="top"><td><code>poslabel</code></td>
<td>
<p>the label position of each class (each level of <code>fac</code>), it can be <code>regular</code> or <code>value</code>. 
If <code>regular</code>, labels are evenly spaced. 
If <code>value</code>, labels are placed on the weighted mean of their class.</p>
</td></tr>
<tr valign="top"><td><code>col</code></td>
<td>
<p>a color or a colors vector for points, labels and lines according to their factor level. 
Colors are recycled whether there are not one color by factor level.</p>
</td></tr>
<tr valign="top"><td><code>facets</code></td>
<td>
<p>a factor splitting <code>score</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>Details</h3>

<p>The weighted means of class are available in the object slot <code>stats</code> using <code>object@stats$means</code>.
Graphical parameters for rugs are available in <code>plines</code> of <code>adegpar</code>.
Some appropriated graphical parameters in <code>p1d</code> are also available.
</p>


<h3>Value</h3>

<p>An object of class <code>ADEg</code> (subclass <code>S1.class</code>) or <code>ADEgS</code> (if <code>add</code> is <code>TRUE</code> and/or 
if facets or data frame for <code>score</code> or data frame for <code>fac</code> 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>S1.class</code>
<code>ADEg.S1</code>
</p>


<h3>Examples</h3>

<pre>
data(meau, package = "ade4")
envpca &lt;- ade4::dudi.pca(meau$env, scannf = FALSE)

g1 &lt;- s1d.class(envpca$li[, 1], meau$design$season, poslabel = "value", col = 1:4, plot = FALSE)
g2 &lt;- s1d.class(envpca$li[, 1], meau$design$season, poslabel = "regular", col = 1:6, 
  p1d.reverse = TRUE, plot = FALSE)
ADEgS(c(g1, g2), layout = c(2, 1))

g3 &lt;- s1d.class(envpca$li[, 1], meau$design$season, poslabel = "value", col = 1:4, 
  plabels.cex = 0, key = list(space = "bottom"))
</pre>


</body></html>
