Description Usage Arguments Value See Also Examples
Create a voronoi tiling geom
1 | gs_voronoi(anchor = NULL, window = NULL, features = 3, ...)
|
anchor |
[ |
window |
[ |
features |
[ |
... |
[various] |
A geom
.
Other tilings:
gs_tiles()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 1. create voronoi polygons programmatically
coords <- data.frame(x = c(40, 70, 70, 50),
y = c(40, 40, 60, 70))
window <- data.frame(x = c(0, 80),
y = c(0, 80))
aGeom <- gs_point(anchor = coords, window = window)
visualise(voronoi = aGeom, linecol = "deeppink")
tiles <- gs_voronoi(anchor = aGeom)
visualise(tiles, new = FALSE)
# 2. sketch a voronoi polygon
if(dev.interactive()){
tiles <- gs_voronoi()
visualise(tiles, new = FALSE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.