EVOLUTION-MANAGER
Edit File: data.class.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: Object Classes</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 data.class {base}"><tr><td>data.class {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Object Classes</h2> <h3>Description</h3> <p>Determine the class of an arbitrary <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> object. </p> <h3>Usage</h3> <pre> data.class(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> object.</p> </td></tr> </table> <h3>Value</h3> <p>character string giving the <em>class</em> of <code>x</code>. </p> <p>The class is the (first element) of the <code><a href="class.html">class</a></code> attribute if this is non-<code>NULL</code>, or inferred from the object's <code>dim</code> attribute if this is non-<code>NULL</code>, or <code>mode(x)</code>. </p> <p>Simply speaking, <code>data.class(x)</code> returns what is typically useful for method dispatching. (Or, what the basic creator functions already and maybe eventually all will attach as a class attribute.) </p> <h3>Note</h3> <p>For compatibility reasons, there is one exception to the rule above: When <code>x</code> is <code><a href="integer.html">integer</a></code>, the result of <code>data.class(x)</code> is <code>"numeric"</code> even when <code>x</code> is classed. </p> <h3>See Also</h3> <p><code><a href="class.html">class</a></code> </p> <h3>Examples</h3> <pre> x <- LETTERS data.class(factor(x)) # has a class attribute data.class(matrix(x, ncol = 13)) # has a dim attribute data.class(list(x)) # the same as mode(x) data.class(x) # the same as mode(x) stopifnot(data.class(1:2) == "numeric") # compatibility "rule" </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>