inla.mesh.create.RdCreate a constrained refined Delaunay triangulation (CRDT) for a set of spatial locations.
inla.mesh.create(loc = NULL,
tv = NULL,
boundary = NULL, interior = NULL,
extend = (missing(tv) || is.null(tv)),
refine = FALSE,
lattice = NULL,
globe = NULL,
cutoff = 1e-12,
plot.delay = NULL,
data.dir,
keep = (!missing(data.dir) && !is.null(data.dir)),
timings = FALSE,
quality.spec = NULL,
crs=NULL)
inla.delaunay(loc, ...)Matrix of point locations.
Can alternatively be a SpatialPoints or SpatialPointsDataFrame object.
A triangle-vertex index matrix, specifying an existing triangulation.
A list of inla.mesh.segment objects, generated by
inla.mesh.segment, specifying boundary constraint segments.
A list of inla.mesh.segment objects, generated by
inla.mesh.segment, specifying interior constraint segments.
logical or list specifying whether to extend the data
region, with parameters
nthe number of edges in the extended boundary (default=8)
offsetthe extension distance. If negative, interpreted as a factor relative to the approximate data diameter (default=-0.10)
Setting to FALSE is only useful in combination lattice
or boundary.
logical or list specifying whether to refine the
triangulation, with parameters
min.anglethe minimum allowed interior angle in any
triangle. The algorithm is guaranteed to converge for
min.angle at most 21 (default=21)
max.edgethe maximum allowed edge length in any
triangle. If negative, interpreted as a relative factor in an
ad hoc formula depending on the data density (default=Inf)
max.n.strictthe maximum number of vertices allowed,
overriding min.angle and max.edge
(default=-1, meaning no limit)
max.nthe maximum number of vertices allowed,
overriding max.edge only (default=-1, meaning no limit)
An inla.mesh.lattice object, generated by
inla.mesh.lattice, specifying points on a regular lattice.
Subdivision resolution for a semi-regular spherical triangulation with equidistant points along equidistant latitude bands.
The minimum allowed distance between points. Point at most as far apart as this are replaced by a single vertex prior to the mesh refinement step.
On Linux (and Mac if appropriate X11 libraries are installed),
specifying a numeric value activates a rudimentary plotting system
in the underlying fmesher program, showing the triangulation
algorithm at work.
Where to store the fmesher data files. Defaults to
tempdir() if keep is FALSE, otherwise
"inla.mesh.data".
TRUE if the data files should be kept in data.dir or
deleted afterwards. Defaults to true if data.dir is
specified, otherwise false. Warning: If
keep is false, data.dir and its contents will be
deleted (unless set to tempdir()).
If TRUE, obtain timings for the mesh construction.
List of vectors of per vertex max.edge target specification
for each location in loc, boundary/interior
(segm), and lattice. Only used if refining the mesh.
An optional CRS or inla.CRS object
Optional parameters passed on to inla.mesh.create.
inla.mesh.create generates triangular meshes on subsets of
\(R^2\) and \(S^2\). Use the higher level wrapper
function inla.mesh.2d for greater control over mesh
resolution and coarser domain extensions.
inla.delaunay is a wrapper function for obtaining the convex
hull of a point set and calling inla.mesh.create to generate
the classical Delaunay tringulation.
An inla.mesh object.
loc = matrix(runif(10*2),10,2)
mesh = inla.delaunay(loc)
#> Error in inla.has_PROJ6(): inla.require("rgdal") is not TRUE
plot(mesh)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'mesh' not found
mesh = inla.mesh.create(loc,
interior=inla.mesh.segment(idx=1:2),
extend=TRUE,
refine=list(max.edge=0.1))
#> Warning: error in running command
#> Error in fmesher.read(prefix, "manifold"): File '/tmp/Rtmp4ztB6d/fmesher53bd24eb01b.manifold' does not exist.
plot(mesh)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'mesh' not found
loc2 = matrix(c(0,1,1,0, 0,0,1,1), 4, 2);
mesh2 = inla.mesh.create(loc=loc,
boundary=inla.mesh.segment(loc2),
interior=inla.mesh.segment(idx=1:2),
quality.spec=list(segm=0.2, loc=0.05),
refine=list(min.angle=26))
#> Error in inla.has_PROJ6(): inla.require("rgdal") is not TRUE
plot(mesh2)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'mesh2' not found