For use with dplyr::summarise, for example

consolidate(x)

Arguments

x

A vector

Source

https://stackoverflow.com/questions/40515180/dplyr-how-to-find-the-first-non-missing-string-by-groups

Value

A single value

Details

This function operates similarly to coalesce for columns, that is picking the first non-missing observation, but on observations rather than variables.

Examples

# NOT RUN {
summarise(mtcars, consolidate(.))
# }