Learn R Programming

easyr (version 0.5-11)

coalf: Factor-friendly Coalesce

Description

Coalesce function that matches and updates factor levels appropriately. Checks each argument vector starting with the first until a non-NA value is found. Author: Bryce Chamberlain.

Usage

coalf(...)

Value

Vector of values.

Arguments

...

Source vectors.

Examples

Run this code
x <- sample(c(1:5, NA, NA, NA))
coalf(x, 0L)

Run the code above in your browser using DataLab