Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.inside

Query if a point is inside the mesh boundary


Description

Query if a point is inside the mesh boundary

Usage

is.inside(mesh, loc, mesh.coords = NULL)

Arguments

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.

Value

Single column matrix of Boolean values indicating if a point is inside the mesh.

Author(s)

Fabian E. Bachl bachlfab@gmail.com

Examples

## 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)

inlabru

Bayesian Latent Gaussian Modelling using INLA and Extensions

v2.3.1
GPL (>= 2)
Authors
Finn Lindgren [aut, cre, cph] (<https://orcid.org/0000-0002-5833-2011>, Finn Lindgren continued development of the main code), Fabian E. Bachl [aut, cph] (Fabian Bachl wrote the main code), David L. Borchers [ctb, dtc, cph] (David Borchers wrote code for Gorilla data import and sampling, multiplot tool), Daniel Simpson [ctb, cph] (Daniel Simpson wrote the basic LGCP sampling method), Lindesay Scott-Howard [ctb, dtc, cph] (Lindesay Scott-Howard provided MRSea data import code), Seaton Andy [ctb] (Andy Seaton provided testing and bugfixes)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.