show_field {stelfi} | R Documentation |
Plot the estimated random field(s) of a fitted LGCP
Description
Plots the values of x
at each node of smesh
, with
optional control over resolutions using dims
.
Usage
show_field(x, smesh, sf, dims = c(500, 500), clip = FALSE)
Arguments
x |
A vector of values, one value per each |
smesh |
A Delaunay triangulation of the spatial domain returned by |
sf |
Optional, |
dims |
A numeric vector of length 2 specifying
the spatial pixel resolution. Default |
clip |
Logical, if |
Value
A gg
class object, values returned by geom_tile
and geom_sf
.
See Also
Examples
if(requireNamespace("fmesher")){
if(require("sf")){
data(xyt, package = "stelfi")
domain <- sf::st_as_sf(xyt$window)
bnd <- fmesher::fm_as_segm(as.matrix(sf::st_coordinates(domain)[, 1:2]))
smesh <- fmesher::fm_mesh_2d(boundary = bnd, max.edge = 0.75, cutoff = 0.3)
parameters <- c(beta = 1, log_tau = log(1), log_kappa = log(1))
simdata <- sim_lgcp(parameters = parameters, sf = domain, smesh = smesh)
show_field(c(simdata$x), smesh = smesh, sf = domain)
show_field(c(simdata$x), smesh = smesh, sf = domain, clip = TRUE)
}
}
[Package stelfi version 1.0.1 Index]