# NOT RUN {
library(sf)
polys <- st_sfc(st_polygon(list(rbind(c(0,0), c(0,1), c(1,1), c(1,0), c(0,0)))),
crs = st_crs('OGC:CRS84'))
points <- st_sfc(st_multipoint(rbind(c(.25, .5), c(.75, .5), c(.5, .5))),
crs = st_crs('OGC:CRS84'))
point.poly.dist(points, polys)
# }
Run the code above in your browser using DataLab