Learn R Programming

easyr (version 0.3-1)

coalf: Factor-friendly Coalesce

Description

Wrapper for the dplyr function "coalesce" which can handle factors appropriately. Checks each argument vector starting with the first until a non-null value is found. Author: Bryce Chamberlain.

Usage

coalf(...)

Arguments

...

Source vectors.

Value

Vector of values.

Examples

Run this code
# NOT RUN {
x <- sample(c(1:5, NA, NA, NA))
coalf(x, 0L)
# }

Run the code above in your browser using DataLab