Query if a point is inside the mesh boundary
Query if a point is inside the mesh boundary
is.inside(mesh, loc, mesh.coords = NULL)
mesh |
an inla.mesh object. |
loc |
Points in space stored either as data.frame, a two-column matrix of x and y coordinates or a SpatialPoints object. |
mesh.coords |
Coordinate names of the mesh. Use only if loc is a data.frame with respective column names. |
Single column matrix of Boolean values indicating if a point is inside the mesh.
Fabian E. Bachl bachlfab@gmail.com
## Not run: if (require("INLA", quietly = TRUE)) { # Load Gorilla data data("gorillas", package = "inlabru") # Check if all Gorilla nests are inside the mesh all(is.inside(gorillas$mesh, gorillas$nests)) # Also works for locations not stored as SpatialPoints object loc <- coordinates(gorillas$nests) all(is.inside(gorillas$mesh, loc)) } ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.