R/df_add_constant_columns.R
df_add_constant_columns.Rd
Add columns with constant values
df_add_constant_columns(x, ccols)
[data.frame] Data frame with at least one row and column.
data.frame
[list] Named list of single elements.
list
Modified data frame.
Other data frame helpers: df_add_category(), df_explode(), df_rows_to_list(), df_split_col()
df_add_category()
df_explode()
df_rows_to_list()
df_split_col()
x = data.frame(a = 1:2, b = 3:4) y = df_add_constant_columns(x, list(c = "a", d = 0.1))