fm_hexagon_lattice | R Documentation |
Create hexagon lattice
points within a boundary
fm_hexagon_lattice(bnd, edge_len = NULL, buffer_n = 1)
bnd |
Boundary object |
edge_len |
Triangle edge length |
buffer_n |
Number of edge length multiples for buffer inside the boundary object to the start of the lattice. Default 1. |
A list with lattice points, edge length, and inner boundary
Man Ho Suen M.H.Suen@sms.ed.ac.uk, Finn Lindgren Finn.Lindgren@gmail.com
(m <- fm_mesh_2d(
fm_hexagon_lattice(
fmexample$boundary_sf[[1]],
edge_len = 0.1
)$lattice,
max.edge = c(0.2, 1),
boundary = fmexample$boundary_sf,
min.angle = c(32, 21)
))
if (require("ggplot2", quietly = TRUE)) {
ggplot() +
geom_fm(data = m)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.