EVOLUTION-MANAGER
Edit File: df_list.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: Collect columns for data frame construction</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 df_list {vctrs}"><tr><td>df_list {vctrs}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Collect columns for data frame construction</h2> <h3>Description</h3> <p><code>df_list()</code> constructs the data structure underlying a data frame, a named list of equal-length vectors. It is often used in combination with <code><a href="new_data_frame.html">new_data_frame()</a></code> to safely and consistently create a helper function for data frame subclasses. </p> <h3>Usage</h3> <pre> df_list( ..., .size = NULL, .unpack = TRUE, .name_repair = c("check_unique", "unique", "universal", "minimal", "unique_quiet", "universal_quiet"), .error_call = current_env() ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>Vectors of equal-length. When inputs are named, those names are used for names of the resulting list.</p> </td></tr> <tr valign="top"><td><code>.size</code></td> <td> <p>The common size of vectors supplied in <code>...</code>. If <code>NULL</code>, this will be computed as the common size of the inputs.</p> </td></tr> <tr valign="top"><td><code>.unpack</code></td> <td> <p>Should unnamed data frame inputs be unpacked? Defaults to <code>TRUE</code>.</p> </td></tr> <tr valign="top"><td><code>.name_repair</code></td> <td> <p>One of <code>"check_unique"</code>, <code>"unique"</code>, <code>"universal"</code>, <code>"minimal"</code>, <code>"unique_quiet"</code>, or <code>"universal_quiet"</code>. See <code><a href="vec_as_names.html">vec_as_names()</a></code> for the meaning of these options.</p> </td></tr> <tr valign="top"><td><code>.error_call</code></td> <td> <p>The execution environment of a currently running function, e.g. <code>caller_env()</code>. The function will be mentioned in error messages as the source of the error. See the <code>call</code> argument of <code><a href="../../rlang/html/abort.html">abort()</a></code> for more information.</p> </td></tr> </table> <h3>Properties</h3> <ul> <li><p> Inputs are <a href="vector_recycling_rules.html">recycled</a> to a common size with <code><a href="vec_recycle.html">vec_recycle_common()</a></code>. </p> </li> <li><p> With the exception of data frames, inputs are not modified in any way. Character vectors are never converted to factors, and lists are stored as-is for easy creation of list-columns. </p> </li> <li><p> Unnamed data frame inputs are automatically unpacked. Named data frame inputs are stored unmodified as data frame columns. </p> </li> <li> <p><code>NULL</code> inputs are completely ignored. </p> </li> <li><p> The dots are dynamic, allowing for splicing of lists with <code style="white-space: pre;">!!!</code> and unquoting. </p> </li></ul> <h3>See Also</h3> <p><code><a href="new_data_frame.html">new_data_frame()</a></code> for constructing data frame subclasses from a validated input. <code><a href="data_frame.html">data_frame()</a></code> for a fast data frame creation helper. </p> <h3>Examples</h3> <pre> # `new_data_frame()` can be used to create custom data frame constructors new_fancy_df <- function(x = list(), n = NULL, ..., class = NULL) { new_data_frame(x, n = n, ..., class = c(class, "fancy_df")) } # Combine this constructor with `df_list()` to create a safe, # consistent helper function for your data frame subclass fancy_df <- function(...) { data <- df_list(...) new_fancy_df(data) } df <- fancy_df(x = 1) class(df) </pre> <hr /><div style="text-align: center;">[Package <em>vctrs</em> version 0.5.0 <a href="00Index.html">Index</a>]</div> </body></html>