(Deprecated) This is 1 of 2 coalesce functions. This one takes fields that are not the same as the proposed new column name. For example, a dataframe with fields "A", "B", and "C" can be coalesced into a field "D". If all the values need to be coalesced into an existing field such as "A", "B", and "C" to "A", use coalesce_at function instead.
coalesce_to(data, col, ..., remove = FALSE)
| 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? |
tidyeval-compat,select,mutate,coalesce
Other coalesce functions:
coalesce_at()
#> 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"#> Error in tibble::as_tibble(list): object 'mtcars_list' not found