coalesce_rows: Get first non-missing

View source: R/wrangling_data.R

coalesce_rowsR Documentation

Get first non-missing

Description

For use with dplyr::summarise, for example

Usage

coalesce_rows(x)

Arguments

x

A vector

Details

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

Value

A single value

Source

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

Examples


dplyr::reframe(emperors$wikipedia, coalesce_rows(emperors$wikipedia))
coalesce_rows(emperors$wikipedia$Begin)


manydata documentation built on May 29, 2024, 8:16 a.m.