inla.mesh.segment.RdConstructs inla.mesh.segment objects that can be used to specify
boundary and interior constraint edges in calls to
inla.mesh.
## Create or join inla.mesh.segment objects.
inla.mesh.segment(...)
# Default S3 method
inla.mesh.segment(loc = NULL, idx = NULL, grp = NULL,
is.bnd = TRUE, crs = NULL, ...)
# S3 method for class 'inla.mesh.segment'
inla.mesh.segment(..., grp.default = 0)
inla.contour.segment(x = seq(0, 1, length.out = nrow(z)),
y = seq(0, 1, length.out = ncol(z)),
z,
nlevels = 10,
levels = pretty(range(z, na.rm = TRUE), nlevels),
groups = seq_len(length(levels)),
positive = TRUE,
eps = NULL,
crs = NULL)Matrix of point locations.
Segment index sequence vector or index pair matrix. The indices
refer to the rows of loc. If loc==NULL, the indices
will be interpreted as indices into the point specification supplied
to inla.mesh.create.
If is.bnd==TRUE, defaults to linking all the points in
loc, as c(1:nrow(loc),1L), otherwise 1:nrow(loc).
Vector of group labels for each segment.
Set to NULL to let the labels be chosen automatically in a
call to inla.mesh.create.
TRUE if the segments are boundary segments, otherwise FALSE.
When joining segments, use this group label for segments that have
grp=NULL.
Parameters specifying a set of surface
contours, with syntax described in contour.
Vector of group ID:s, one for each contour level.
TRUE if the contours should encircle positive
level excursions in a counter clockwise direction.
Tolerance for inla.simplify.curve.
An optional CRS or inla.CRS object
Additional parameters. When joining segments, a list of
inla.mesh.segment objects.
An inla.mesh.segment object.
## Create a square boundary and a diagonal interior segment
loc.bnd = matrix(c(0,0, 1,0, 1,1, 0,1), 4, 2, byrow=TRUE)
loc.int = matrix(c(0.9,0.1, 0.1,0.6), 2, 2, byrow=TRUE)
segm.bnd = inla.mesh.segment(loc.bnd)
segm.int = inla.mesh.segment(loc.int, is.bnd=FALSE)
## Points to be meshed
loc = matrix(runif(10*2),10,2)*0.9+0.05
mesh = inla.mesh.create(loc,
boundary=segm.bnd,
interior=segm.int,
refine=list())
#> 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
if (FALSE) { # \dontrun{
mesh = inla.mesh.create(loc, interior=list(segm.bnd, segm.int))
plot(mesh)
} # }