EVOLUTION-MANAGER
Edit File: prepend.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: Prepend a vector</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 prepend {purrr}"><tr><td>prepend {purrr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Prepend a vector</h2> <h3>Description</h3> <p>This is a companion to <code><a href="../../base/html/append.html">append()</a></code> to help merging two lists or atomic vectors. <code>prepend()</code> is a clearer semantic signal than <code>c()</code> that a vector is to be merged at the beginning of another, especially in a pipe chain. </p> <h3>Usage</h3> <pre> prepend(x, values, before = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>the vector to be modified.</p> </td></tr> <tr valign="top"><td><code>values</code></td> <td> <p>to be included in the modified vector.</p> </td></tr> <tr valign="top"><td><code>before</code></td> <td> <p>a subscript, before which the values are to be appended. If <code>NULL</code>, values will be appended at the beginning even for <code>x</code> of length 0.</p> </td></tr> </table> <h3>Value</h3> <p>A merged vector. </p> <h3>Examples</h3> <pre> x <- as.list(1:3) x %>% append("a") x %>% prepend("a") x %>% prepend(list("a", "b"), before = 3) prepend(list(), x) </pre> <hr /><div style="text-align: center;">[Package <em>purrr</em> version 0.3.4 <a href="00Index.html">Index</a>]</div> </body></html>