I found a method for drawing Voronoi tessellation segments using ggplot2:
library(deldir) library(ggplot2) library(ggthemes) set.seed(123) df <- data.frame(lat = rnorm(20,39,10),long = rnorm(20,-98,15)) voronoi <- deldir(df$long, df$lat) ggplot(data=df, aes(x=long,y=lat)) + geom_segment(aes(x = x1, y = y1, xend = x2, yend = y2),size = 2,data = voronoi$dirsgs,linetype = 1,color= "#419AB0") + geom_point(fill="#EACA3E",pch=21,size = 4,color="white")
I would like to know if it is possible to draw polygons on segments, but I do not know how to create a dataset with the outline of each polygon.
source share