Learn R Programming

inlabru (version 2.8.0)

pixels: Generate SpatialPixels covering an inla.mesh

Description

Generate SpatialPixels covering an inla.mesh

Usage

pixels(mesh, nx = 150, ny = 150, mask = TRUE)

Value

SpatialPixelsDataFrame covering the mesh

Arguments

mesh

An inla.mesh object

nx

Number of pixels in x direction

ny

Number of pixels in y direction

mask

If logical and TRUE, remove pixels that are outside the mesh. If mask is a Spatial object, only return pixels covered by this object.

Author

Fabian E. Bachl bachlfab@gmail.com

See Also

fm_pixels()

Examples

Run this code
# \donttest{
if (require(ggplot2, quietly = TRUE)) {
  data("mrsea", package = "inlabru")
  pxl <- fm_pixels(mrsea$mesh,
    nx = 50, ny = 50, mask = mrsea$boundary,
    format = "sp"
  )
  ggplot() +
    gg(pxl, fill = "grey", alpha = 0.5) +
    gg(mrsea$mesh)
}
# }

Run the code above in your browser using DataLab