Learn R Programming

inlabru (version 2.8.0)

fm_vertices: Extract vertex locations from an inla.mesh

Description

Extracts the vertices of an inla.mesh object.

Usage

fm_vertices(x, format = NULL)

Value

An sf, data.frame, or SpatialPointsDataFrame object, with the vertex coordinates, and a .vertex column with the vertex indices.

Arguments

x

An inla.mesh object.

format

character; "sf", "df", "sp"

Author

Fabian E. Bachl bachlfab@gmail.com, Finn Lindgren finn.lindgren@gmail.com

See Also

fm_centroids()

Examples

Run this code
# \donttest{
if (require(ggplot2, quietly = TRUE)) {
  data("mrsea", package = "inlabru")
  vrt <- fm_vertices(mrsea$mesh, format = "sp")
  ggplot() +
    gg(mrsea$mesh) +
    gg(vrt, color = "red")
}
# }

Run the code above in your browser using DataLab