EVOLUTION-MANAGER
Edit File: cols.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: Create column specification</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 cols {readr}"><tr><td>cols {readr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create column specification</h2> <h3>Description</h3> <p><code>cols()</code> includes all columns in the input data, guessing the column types as the default. <code>cols_only()</code> includes only the columns you explicitly specify, skipping the rest. </p> <h3>Usage</h3> <pre> cols(..., .default = col_guess()) cols_only(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>Either column objects created by <code>col_*()</code>, or their abbreviated character names (as described in the <code>col_types</code> argument of <code><a href="read_delim.html">read_delim()</a></code>). If you're only overriding a few columns, it's best to refer to columns by name. If not named, the column types must match the column names exactly.</p> </td></tr> <tr valign="top"><td><code>.default</code></td> <td> <p>Any named columns not explicitly overridden in <code>...</code> will be read with this column type.</p> </td></tr> </table> <h3>Details</h3> <p>The available specifications are: (with string abbreviations in brackets) </p> <ul> <li> <p><code>col_logical()</code> [l], containing only <code>T</code>, <code>F</code>, <code>TRUE</code> or <code>FALSE</code>. </p> </li> <li> <p><code>col_integer()</code> [i], integers. </p> </li> <li> <p><code>col_double()</code> [d], doubles. </p> </li> <li> <p><code>col_character()</code> [c], everything else. </p> </li> <li> <p><code>col_factor(levels, ordered)</code> [f], a fixed set of values. </p> </li> <li> <p><code>col_date(format = "")</code> [D]: with the locale's <code>date_format</code>. </p> </li> <li> <p><code>col_time(format = "")</code> [t]: with the locale's <code>time_format</code>. </p> </li> <li> <p><code>col_datetime(format = "")</code> [T]: ISO8601 date times </p> </li> <li> <p><code>col_number()</code> [n], numbers containing the <code>grouping_mark</code> </p> </li> <li> <p><code>col_skip()</code> [_, -], don't import this column. </p> </li> <li> <p><code>col_guess()</code> [?], parse using the "best" type based on the input. </p> </li></ul> <h3>See Also</h3> <p>Other parsers: <code><a href="col_skip.html">col_skip</a></code>, <code><a href="spec.html">cols_condense</a></code>, <code><a href="parse_datetime.html">parse_datetime</a></code>, <code><a href="parse_factor.html">parse_factor</a></code>, <code><a href="parse_guess.html">parse_guess</a></code>, <code><a href="parse_atomic.html">parse_logical</a></code>, <code><a href="parse_number.html">parse_number</a></code>, <code><a href="parse_vector.html">parse_vector</a></code> </p> <h3>Examples</h3> <pre> cols(a = col_integer()) cols_only(a = col_integer()) # You can also use the standard abbreviations cols(a = "i") cols(a = "i", b = "d", c = "_") # You can also use multiple sets of column definitions by combining # them like so: t1 <- cols( column_one = col_integer(), column_two = col_number()) t2 <- cols( column_three = col_character()) t3 <- t1 t3$cols <- c(t1$cols, t2$cols) t3 </pre> <hr /><div style="text-align: center;">[Package <em>readr</em> version 1.3.1 <a href="00Index.html">Index</a>]</div> </body></html>