# \donttest{
if (requireNamespace("spatstat.geom") && requireNamespace("spatstat.random")) {
poly_x <- c(0, 2, 2, 0)
poly_y <- c(0, 0, 1, 1)
win_poly <- spatstat.geom::owin(poly = list(x = poly_x, y = poly_y))
plot(win_poly)
coors1 <- spatstat_layout(co_net, win_poly, type = "regular", mode = "surface")
plot(co_net, coors = coors1)
coors2 <- spatstat_layout(co_net2, win_poly, type = "random", mode = "boundary")
plot(co_net2, coors = coors2)
if (requireNamespace("sf")) {
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
poly <- nc[1, ]
coors <- spatstat_layout(go = multi1, win = poly, type = "regular", mode = "surface")
plot(multi1, coors = coors)
}
}
# }
Run the code above in your browser using DataLab