pixels | R Documentation |
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)
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 |
SpatialPixelsDataFrame
covering the mesh
Fabian E. Bachl bachlfab@gmail.com
fm_pixels()
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.