EVOLUTION-MANAGER
Edit File: nlevels.html
<!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: The Number of Levels of a Factor</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for nlevels {base}"><tr><td>nlevels {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>The Number of Levels of a Factor</h2> <h3>Description</h3> <p>Return the number of levels which its argument has. </p> <h3>Usage</h3> <pre> nlevels(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>an object, usually a factor.</p> </td></tr> </table> <h3>Details</h3> <p>This is usually applied to a factor, but other objects can have levels. </p> <p>The actual factor levels (if they exist) can be obtained with the <code><a href="levels.html">levels</a></code> function. </p> <h3>Value</h3> <p>The length of <code><a href="levels.html">levels</a>(x)</code>, which is zero if <code>x</code> has no levels. </p> <h3>See Also</h3> <p><code><a href="levels.html">levels</a></code>, <code><a href="factor.html">factor</a></code>. </p> <h3>Examples</h3> <pre> nlevels(gl(3, 7)) # = 3 </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>