I want to sample points (latitude-longitude pairs) on borders of the US states, or points close to borders. With the following code, I am able to sample points in an example multipolygon. How can I do this on the borders instead?
library(sf) nc = st_read(system.file("shape/nc.shp", package="sf")) plot(nc$geometry[1]) plot(st_sample(nc$geometry[1], 1000))