st_min_dist: Function for creating a numeric vector showing the smallest...

Description Usage Arguments Examples

View source: R/st_min_dist.R

Description

Function for creating a numeric vector showing the smallest distance between the feature in the primary sf object and all features in the second object

Usage

1

Arguments

x

the primary sf object

y

the second sf object

Examples

1
2
3
4
5
6
library(sf)
records <- readxl::read_excel(system.file("data/records.xlsx", package = "ALERC")) %>%
  st_as_sf(coords = c("Easting", "Northing"), crs = 27700)
sssi <- st_read(system.file("data/SSSI.shp", package = "ALERC")) %>%
  st_set_crs(27700)
records$DistFromSSSI <- st_min_dist(records, sssi)

tvercrobbie/ALERC documentation built on Oct. 11, 2020, 12:56 a.m.