library(sf)
nc <- sf::st_read(system.file("shape/nc.shp", package="sf"))
nc <- suppressWarnings(sf::st_cast(nc, "POLYGON"))
nc <- nc[c(10,50),]
( v <- extract.vertices(nc) )
plot(st_geometry(nc))
plot(st_geometry(v), pch=20, cex=2, col="red", add=TRUE)
Run the code above in your browser using DataLab