coalesce_to: Coalesce 1+ Fields to a New Field

Description Usage Arguments See Also Examples

View source: R/coalesce_.R

Description

(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.

Usage

1

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

tidyeval-compat,select,mutate,coalesce

Other coalesce functions: coalesce_at()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Load Data
data(mtcars)

# To List of Vectors
cols_to_list(data = mtcars)


cols_to_list(data = mtcars,
             vs, am, gear)


# List to Dataframe
mtcars_list <- cols_to_list(data = mtcars)
list_to_tibble(mtcars_list)

meerapatelmd/rubix documentation built on Sept. 5, 2021, 8:30 p.m.