EVOLUTION-MANAGER
Edit File: add_row.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: Add rows to a data frame</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 add_row {tibble}"><tr><td>add_row {tibble}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Add rows to a data frame</h2> <h3>Description</h3> <p>This is a convenient way to add one or more rows of data to an existing data frame. See <code><a href="tribble.html">tribble()</a></code> for an easy way to create an complete data frame row-by-row. Use <code><a href="tibble.html">tibble_row()</a></code> to ensure that the new data has only one row. </p> <p><code>add_case()</code> is an alias of <code>add_row()</code>. </p> <h3>Usage</h3> <pre> add_row(.data, ..., .before = NULL, .after = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>.data</code></td> <td> <p>Data frame to append to.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p><<code><a href="../../rlang/html/dyn-dots.html">dynamic-dots</a></code>> Name-value pairs, passed on to <code><a href="tibble.html">tibble()</a></code>. Values can be defined only for columns that already exist in <code>.data</code> and unset columns will get an <code>NA</code> value.</p> </td></tr> <tr valign="top"><td><code>.before, .after</code></td> <td> <p>One-based row index where to add the new rows, default: after last row.</p> </td></tr> </table> <h3>See Also</h3> <p>Other addition: <code><a href="add_column.html">add_column</a>()</code> </p> <h3>Examples</h3> <pre> # add_row --------------------------------- df <- tibble(x = 1:3, y = 3:1) df %>% add_row(x = 4, y = 0) # You can specify where to add the new rows df %>% add_row(x = 4, y = 0, .before = 2) # You can supply vectors, to add multiple rows (this isn't # recommended because it's a bit hard to read) df %>% add_row(x = 4:5, y = 0:-1) # Use tibble_row() to add one row only df %>% add_row(tibble_row(x = 4, y = 0)) try(df %>% add_row(tibble_row(x = 4:5, y = 0:-1))) # Absent variables get missing values df %>% add_row(x = 4) # You can't create new variables try(df %>% add_row(z = 10)) </pre> <hr /><div style="text-align: center;">[Package <em>tibble</em> version 3.1.8 <a href="00Index.html">Index</a>]</div> </body></html>