# NOT RUN {
# Create centroids set
centroids <- create_centroids(tas_lga, "LGA_CODE16")
# Create hexagon location grid
grid <- create_grid(centroids = centroids, hex_size = 0.2, buffer_dist = 1.2)
# Allocate polygon centroids to hexagon grid points
allocated <- allocate(
centroids = centroids,
sf_id = "LGA_CODE16",
hex_grid = grid,
hex_size = 0.2, # same size used in create_grid
hex_filter = 1,
width = 30,
focal_points = capital_cities,
verbose = TRUE
)
# same column used in create_centroids
fortify_hexagon(data = allocated, sf_id = "LGA_CODE16", hex_size = 0.2)
# }
Run the code above in your browser using DataLab