pixels {inlabru} | R Documentation |
Generate SpatialPixels
covering an inla.mesh
Description
in favour of fmesher::fm_pixels()
Generate SpatialPixels
covering an inla.mesh
.
Usage
pixels(mesh, nx = 150, ny = 150, mask = TRUE)
Arguments
mesh |
An |
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 |
Value
SpatialPixelsDataFrame
covering the mesh
Author(s)
Fabian E. Bachl bachlfab@gmail.com
See Also
Examples
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)
}
[Package inlabru version 2.10.1 Index]