EVOLUTION-MANAGER
Edit File: list_of.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: 'list_of' S3 class for homogenous lists</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 list_of {vctrs}"><tr><td>list_of {vctrs}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2><code>list_of</code> S3 class for homogenous lists</h2> <h3>Description</h3> <p>A <code>list_of</code> object is a list where each element has the same type. Modifying the list with <code>$</code>, <code>[</code>, and <code>[[</code> preserves the constraint by coercing all input items. </p> <h3>Usage</h3> <pre> list_of(..., .ptype = NULL) as_list_of(x, ...) is_list_of(x) ## S3 method for class 'vctrs_list_of' vec_ptype2(x, y, ..., x_arg = "", y_arg = "") ## S3 method for class 'vctrs_list_of' vec_cast(x, to, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>Vectors to coerce.</p> </td></tr> <tr valign="top"><td><code>.ptype</code></td> <td> <p>If <code>NULL</code>, the default, the output type is determined by computing the common type across all elements of <code>...</code>. </p> <p>Alternatively, you can supply <code>.ptype</code> to give the output known type. If <code>getOption("vctrs.no_guessing")</code> is <code>TRUE</code> you must supply this value: this is a convenient way to make production code demand fixed types.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>For <code>as_list_of()</code>, a vector to be coerced to list_of.</p> </td></tr> <tr valign="top"><td><code>y, to</code></td> <td> <p>Arguments to <code>vec_ptype2()</code> and <code>vec_cast()</code>.</p> </td></tr> <tr valign="top"><td><code>x_arg, y_arg</code></td> <td> <p>Argument names for <code>x</code> and <code>y</code>. These are used in error messages to inform the user about the locations of incompatible types (see <code><a href="vctrs-conditions.html">stop_incompatible_type()</a></code>).</p> </td></tr> </table> <h3>Details</h3> <p>Unlike regular lists, setting a list element to <code>NULL</code> using <code>[[</code> does not remove it. </p> <h3>Examples</h3> <pre> x <- list_of(1:3, 5:6, 10:15) if (requireNamespace("tibble", quietly = TRUE)) { tibble::tibble(x = x) } vec_c(list_of(1, 2), list_of(FALSE, TRUE)) </pre> <hr /><div style="text-align: center;">[Package <em>vctrs</em> version 0.5.0 <a href="00Index.html">Index</a>]</div> </body></html>