Description Usage Arguments Value Author(s) See Also Examples
Constructs inla.mesh.segment
objects that can be used to specify
boundary and interior constraint edges in calls to
inla.mesh
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## 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)
|
loc |
Matrix of point locations. |
idx |
Segment index sequence vector or index pair matrix. The indices
refer to the rows of |
grp |
Vector of group labels for each segment.
Set to |
is.bnd |
|
grp.default |
When joining segments, use this group label for segments that have
|
x, y, z, nlevels, levels |
Parameters specifying a set of surface
contours, with syntax described in |
groups |
Vector of group ID:s, one for each contour level. |
positive |
|
eps |
Tolerance for |
crs |
An optional |
... |
Additional parameters. When joining segments, a list of
|
An inla.mesh.segment
object.
Finn Lindgren finn.lindgren@gmail.com
inla.mesh.create
,
inla.mesh.2d
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## 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())
plot(mesh)
## Not run:
mesh = inla.mesh.create(loc, interior=list(segm.bnd, segm.int))
plot(mesh)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.