EVOLUTION-MANAGER
Edit File: deprecated-se.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: Deprecated SE versions of main verbs</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 deprecated-se {tidyr}"><tr><td>deprecated-se {tidyr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Deprecated SE versions of main verbs</h2> <h3>Description</h3> <p><img src="../help/figures/lifecycle-deprecated.svg" alt='Deprecated lifecycle' /> </p> <p>tidyr used to offer twin versions of each verb suffixed with an underscore. These versions had standard evaluation (SE) semantics: rather than taking arguments by code, like NSE verbs, they took arguments by value. Their purpose was to make it possible to program with tidyr. However, tidyr now uses tidy evaluation semantics. NSE verbs still capture their arguments, but you can now unquote parts of these arguments. This offers full programmability with NSE verbs. Thus, the underscored versions are now superfluous. </p> <p>Unquoting triggers immediate evaluation of its operand and inlines the result within the captured expression. This result can be a value or an expression to be evaluated later with the rest of the argument. See <code>vignette("programming", "dplyr")</code> for more information. </p> <h3>Usage</h3> <pre> complete_(data, cols, fill = list(), ...) drop_na_(data, vars) expand_(data, dots, ...) crossing_(x) nesting_(x) extract_( data, col, into, regex = "([[:alnum:]]+)", remove = TRUE, convert = FALSE, ... ) fill_(data, fill_cols, .direction = c("down", "up")) gather_( data, key_col, value_col, gather_cols, na.rm = FALSE, convert = FALSE, factor_key = FALSE ) nest_(...) separate_rows_(data, cols, sep = "[^[:alnum:].]+", convert = FALSE) separate_( data, col, into, sep = "[^[:alnum:]]+", remove = TRUE, convert = FALSE, extra = "warn", fill = "warn", ... ) spread_( data, key_col, value_col, fill = NA, convert = FALSE, drop = TRUE, sep = NULL ) unite_(data, col, from, sep = "_", remove = TRUE) unnest_(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>data</code></td> <td> <p>A data frame</p> </td></tr> <tr valign="top"><td><code>fill</code></td> <td> <p>A named list that for each variable supplies a single value to use instead of <code>NA</code> for missing combinations.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Specification of columns to expand. Columns can be atomic vectors or lists. </p> <ul> <li><p> To find all unique combinations of <code>x</code>, <code>y</code> and <code>z</code>, including those not present in the data, supply each variable as a separate argument: <code>expand(df, x, y, z)</code>. </p> </li> <li><p> To find only the combinations that occur in the data, use <code>nesting</code>: <code>expand(df, nesting(x, y, z))</code>. </p> </li> <li><p> You can combine the two forms. For example, <code>expand(df, nesting(school_id, student_id), date)</code> would produce a row for each present school-student combination for all possible dates. </p> </li></ul> <p>When used with factors, <code>expand()</code> uses the full set of levels, not just those that appear in the data. If you want to use only the values seen in the data, use <code>forcats::fct_drop()</code>. </p> <p>When used with continuous variables, you may need to fill in values that do not appear in the data: to do so use expressions like <code>year = 2010:2020</code> or <code style="white-space: pre;">year = \link{full_seq}(year,1)</code>.</p> </td></tr> <tr valign="top"><td><code>vars, cols, col</code></td> <td> <p>Name of columns.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>For <code>nesting_</code> and <code>crossing_</code> a list of variables.</p> </td></tr> <tr valign="top"><td><code>into</code></td> <td> <p>Names of new variables to create as character vector. Use <code>NA</code> to omit the variable in the output.</p> </td></tr> <tr valign="top"><td><code>regex</code></td> <td> <p>a regular expression used to extract the desired values. There should be one group (defined by <code style="white-space: pre;">()</code>) for each element of <code>into</code>.</p> </td></tr> <tr valign="top"><td><code>remove</code></td> <td> <p>If <code>TRUE</code>, remove input column from output data frame.</p> </td></tr> <tr valign="top"><td><code>convert</code></td> <td> <p>If <code>TRUE</code>, will run <code><a href="../../utils/html/type.convert.html">type.convert()</a></code> with <code>as.is = TRUE</code> on new columns. This is useful if the component columns are integer, numeric or logical. </p> <p>NB: this will cause string <code>"NA"</code>s to be converted to <code>NA</code>s.</p> </td></tr> <tr valign="top"><td><code>fill_cols</code></td> <td> <p>Character vector of column names.</p> </td></tr> <tr valign="top"><td><code>.direction</code></td> <td> <p>Direction in which to fill missing values. Currently either "down" (the default), "up", "downup" (i.e. first down and then up) or "updown" (first up and then down).</p> </td></tr> <tr valign="top"><td><code>key_col, value_col</code></td> <td> <p>Strings giving names of key and value cols.</p> </td></tr> <tr valign="top"><td><code>gather_cols</code></td> <td> <p>Character vector giving column names to be gathered into pair of key-value columns.</p> </td></tr> <tr valign="top"><td><code>na.rm</code></td> <td> <p>If <code>TRUE</code>, will remove rows from output where the value column is <code>NA</code>.</p> </td></tr> <tr valign="top"><td><code>factor_key</code></td> <td> <p>If <code>FALSE</code>, the default, the key values will be stored as a character vector. If <code>TRUE</code>, will be stored as a factor, which preserves the original ordering of the columns.</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p><img src="../help/figures/lifecycle-deprecated.svg" alt='Deprecated lifecycle' />: use <code>names_sep</code> instead.</p> </td></tr> <tr valign="top"><td><code>extra</code></td> <td> <p>If <code>sep</code> is a character vector, this controls what happens when there are too many pieces. There are three valid options: </p> <ul> <li><p> "warn" (the default): emit a warning and drop extra values. </p> </li> <li><p> "drop": drop any extra values without a warning. </p> </li> <li><p> "merge": only splits at most <code>length(into)</code> times </p> </li></ul> </td></tr> <tr valign="top"><td><code>drop</code></td> <td> <p><img src="../help/figures/lifecycle-deprecated.svg" alt='Deprecated lifecycle' />: all list-columns are now preserved; If there are any that you don't want in the output use <code>select()</code> to remove them prior to unnesting.</p> </td></tr> <tr valign="top"><td><code>from</code></td> <td> <p>Names of existing columns as character vector</p> </td></tr> <tr valign="top"><td><code>expand_cols</code></td> <td> <p>Character vector of column names to be expanded.</p> </td></tr> </table> <hr /><div style="text-align: center;">[Package <em>tidyr</em> version 1.1.2 <a href="00Index.html">Index</a>]</div> </body></html>