# Create centroids set
centroids <- create_centroids(tas_lga, sf_id = "lga_code_2016")
# Smaller set for faster example
centroids <- centroids[1:10,]
# Create hexagon location grid
data(capital_cities)
grid <- create_grid(centroids = centroids, hex_size = 0.2, buffer_dist = 1.2)
# Allocate polygon centroids to hexagon grid points
hex_allocated <- allocate(
centroids = centroids,
hex_grid = grid,
hex_size = 0.2, # same size used in create_grid
hex_filter = 3,
focal_points = capital_cities,
width = 30,
verbose = TRUE
)
# NEXT:
# create a set of hexagon points for plotting
# using fortify_hexagon, and
# plot the hexagons with geom_polygon, see vignette
Run the code above in your browser using DataLab