Coalesce a set of fields to an existing column `col` in the order in which the arguments are supplied with `col` leading.

coalesce_at(data, col, ..., remove = TRUE)

Arguments

data

A dataframe or tibble.

col

Target column.

...

Other columns in addition to `col` that will be coalesced in the correct order of precedence.

remove

Should columns supplied in `...` be removed in the output?

See also

Examples

# Load Data data(mtcars) # To List of Vectors cols_to_list(data = mtcars)
#> Error in cols_to_list(data = mtcars): could not find function "cols_to_list"
cols_to_list(data = mtcars, vs, am, gear)
#> Error in cols_to_list(data = mtcars, vs, am, gear): could not find function "cols_to_list"
# List to Dataframe mtcars_list <- cols_to_list(data = mtcars)
#> Error in cols_to_list(data = mtcars): could not find function "cols_to_list"
list_to_tibble(mtcars_list)
#> Error in tibble::as_tibble(list): object 'mtcars_list' not found