Skip to contents

Geometry matching

Usage

st_match(x)

Arguments

x

An object of class sf or sfc.

Value

A numeric vector giving for each feature in x the position of the first feature in x that has an equal geometry.

See also

Examples

library(sf, quietly = TRUE)

p1 = st_sfc(st_point(c(1, 1)))
p2 = st_sfc(st_point(c(0, 0)))
p3 = st_sfc(st_point(c(1, 0)))

st_match(c(p1, p2, p2, p3, p1))
#> [1] 1 2 2 3 1