library(sf)
x = st_multipoint(matrix(c(0,1,0,1),2,2))
y = st_multipoint(matrix(c(0,0,1,0,1,1),3,2))
mbcx = st_minimum_bounding_circle(x)
mbcy = st_minimum_bounding_circle(y)
if (.Platform$OS.type != "windows") {
plot(mbcx, axes=TRUE); plot(x, add=TRUE)
plot(mbcy, axes=TRUE); plot(y, add=TRUE)
}
nc = st_read(system.file("gpkg/nc.gpkg", package="sf"))
state = st_union(st_geometry(nc))
if (.Platform$OS.type != "windows") {
plot(st_minimum_bounding_circle(state), asp=1)
plot(state, add=TRUE)
}
Run the code above in your browser using DataLab