fm_centroids | R Documentation |
fm_mesh_2d
Computes the centroids of the triangles of an fm_mesh_2d()
object.
fm_centroids(x, format = NULL)
x |
An |
format |
character; |
An sf
, data.frame
, or SpatialPointsDataFrame
object, with the vertex
coordinates, and a .triangle
column with the triangle indices.
Finn Lindgren finn.lindgren@gmail.com
fm_vertices()
if (require("ggplot2", quietly = TRUE)) {
vrt <- fm_centroids(fmexample$mesh, format = "sf")
ggplot() +
geom_sf(data = fm_as_sfc(fmexample$mesh)) +
geom_sf(data = vrt, color = "red")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.