add_column

0th

Percentile

Add columns to a data frame

This is a convenient way to add one or more columns to an existing data frame.

Usage
add_column(.data, ..., .before = NULL, .after = NULL)
Arguments
.data

Data frame to append to.

...

Name-value pairs, all values must have one element for each row in the data frame, or be of length 1

.before, .after

One-based column index or column name where to add the new columns, default: after last column

See Also

Other addition: add_row

Aliases
  • add_column
Examples
# NOT RUN {
# add_row ---------------------------------
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)
# }
# NOT RUN {
# You can't create new observations
# }
# NOT RUN {
add_column(df, z = 1:5)
# }
Documentation reproduced from package tibble, version 1.3.4, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.