in favour of fmesher::fm_pixels()
Generate SpatialPixels
covering an inla.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 aSpatial
object, only return pixels covered by this object.
Author
Fabian E. Bachl bachlfab@gmail.com
Examples
# \donttest{
if (require(ggplot2, quietly = TRUE)) {
data("mrsea", package = "inlabru")
pxl <- fm_pixels(
mrsea$mesh,
dims = c(50, 50),
mask = mrsea$boundary,
format = "sp",
minimal = TRUE
)
ggplot() +
gg(pxl, fill = "blue", alpha = 0.75) +
gg(mrsea$mesh)
pxl <- fm_pixels(
mrsea$mesh,
dims = c(50, 50),
mask = mrsea$boundary,
format = "sf",
minimal = TRUE
)
ggplot() +
gg(pxl, geom = "tile", fill = "blue", alpha = 0.75) +
gg(mrsea$mesh)
}
# }