powered by
fm_mesh_2d
Computes the centroids of the triangles of an fm_mesh_2d() object.
fm_mesh_2d()
fm_centroids(x, format = NULL)
An sf, data.frame, or SpatialPointsDataFrame object, with the vertex coordinates, and a .triangle column with the triangle indices.
sf
data.frame
SpatialPointsDataFrame
.triangle
An fm_mesh_2d object.
character; "sf", "df", "sp"
"sf"
"df"
"sp"
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") }
Run the code above in your browser using DataLab