R/utils.R
st_match.Rd
Geometry matching
st_match(x)
An object of class sf or sfc.
sf
sfc
A numeric vector giving for each feature in x the position of the first feature in x that has an equal geometry.
x
match
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