EVOLUTION-MANAGER
Edit File: new_factor.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: Factor/ordered factor S3 class</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 new_factor {vctrs}"><tr><td>new_factor {vctrs}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Factor/ordered factor S3 class</h2> <h3>Description</h3> <p>A <a href="../../base/html/factor.html">factor</a> is an integer with attribute <code>levels</code>, a character vector. There should be one level for each integer between 1 and <code>max(x)</code>. An <a href="../../base/html/factor.html">ordered</a> factor has the same properties as a factor, but possesses an extra class that marks levels as having a total ordering. </p> <h3>Usage</h3> <pre> new_factor(x = integer(), levels = character(), ..., class = character()) new_ordered(x = integer(), levels = character()) ## S3 method for class 'factor' vec_ptype2(x, y, ...) ## S3 method for class 'ordered' vec_ptype2(x, y, ...) ## S3 method for class 'factor' vec_cast(x, to, ...) ## S3 method for class 'ordered' vec_cast(x, to, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>Integer values which index in to <code>levels</code>.</p> </td></tr> <tr valign="top"><td><code>levels</code></td> <td> <p>Character vector of labels.</p> </td></tr> <tr valign="top"><td><code>..., class</code></td> <td> <p>Used to for subclasses.</p> </td></tr> </table> <h3>Details</h3> <p>These functions help the base factor and ordered factor classes fit in to the vctrs type system by providing constructors, coercion functions, and casting functions. <code>new_factor()</code> and <code>new_ordered()</code> are low-level constructors - they only check that types, but not values, are valid, so are for expert use only. </p> <hr /><div style="text-align: center;">[Package <em>vctrs</em> version 0.5.0 <a href="00Index.html">Index</a>]</div> </body></html>