Description Usage Arguments See Also Examples
This is a convenient way to add one or more columns to an existing data frame.
1 | add_column(.data, ..., .before = NULL, .after = NULL)
|
.data |
Data frame to append to. |
... |
Name-value pairs, passed on to |
.before, .after |
One-based column index or column name where to add the new columns, default: after last column. |
Other addition:
add_row()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # add_column ---------------------------------
df <- tibble(x = 1:3, y = 3:1)
add_column(df, z = -1:1, w = 0)
# You can't overwrite existing columns
## Not run:
add_column(df, x = 4:6)
## End(Not run)
# You can't create new observations
## Not run:
add_column(df, z = 1:5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.