Learn R Programming

inlabru (version 2.8.0)

fm_is_within: Query if points are inside a mesh

Description

Queries whether each input point is within a mesh or not.

Usage

fm_is_within(x, y, ...)

# S3 method for default fm_is_within(x, y, ...)

Value

A logical vector

Arguments

x

A set of points of a class supported by fm_evaluator(y, loc = x)

y

An inla.mesh

...

Currently unused

Examples

Run this code
if (FALSE) {
if (bru_safe_inla(quietly = TRUE)) {
  # Load Gorilla data

  data("gorillas", package = "inlabru")

  # Check if all Gorilla nests are inside the mesh

  all(fm_is_within(gorillas$nests, gorillas$mesh))

  # Also works for locations not stored as SpatialPoints object

  loc <- coordinates(gorillas$nests)
  all(fm_is_within(loc, gorillas$mesh))
}
}

Run the code above in your browser using DataLab