SpatialPixels
covering an inla.mesh
in favour of
fmesher::fm_pixels()
Generate SpatialPixels
covering an inla.mesh
.
pixels(mesh, nx = 150, ny = 150, mask = TRUE)
SpatialPixelsDataFrame
covering the mesh
An inla.mesh
object
Number of pixels in x direction
Number of pixels in y direction
If logical and TRUE, remove pixels that are outside the mesh.
If mask
is a Spatial
object, only return pixels covered by this object.
Fabian E. Bachl bachlfab@gmail.com
fm_pixels()
# \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)
}
# }
Run the code above in your browser using DataLab