geo_coalesce: Find first non-empty feature

Description Usage Arguments Value Examples

View source: R/geo-coalesce.R

Description

Like dplyr::coalesce(), geo_coalesce() returns the first non-missing element (rowwise). It is useful for replacing empty and missing values with a default.

Usage

1

Arguments

x, ...

Vectors that will be recycled to a common length. These don't necessarily need to be geovctrs, but do need methods for geo_is_empty() and must be castable to the type of the first argument.

Value

A vector with the type of the first argument.

Examples

1
2
wkt <- wkt(c("POINT (30 10)", "POINT EMPTY", NA))
geo_coalesce(wkt, wkt("POINT (0 0)"))

paleolimbot/geovctrs documentation built on July 30, 2020, 3:41 p.m.