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)


globalgov/manydata documentation built on May 10, 2024, 9:48 p.m.