Description Usage Arguments Details Value Author(s) See Also Examples
Calculate a lattice projection to/from an inla.mesh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | inla.mesh.project(...)
inla.mesh.projector(...)
## S3 method for class 'inla.mesh'
inla.mesh.projector(mesh,
loc = NULL,
lattice = NULL,
xlim = range(mesh$loc[,1]),
ylim = range(mesh$loc[,2]),
dims = c(100,100),
projection = NULL,
...)
## S3 method for class 'inla.mesh.1d'
inla.mesh.projector(mesh,
loc = NULL,
xlim = mesh$interval,
dims = 100, ...)
## S3 method for class 'inla.mesh.projector'
inla.mesh.project(projector, field, ...)
## S3 method for class 'inla.mesh'
inla.mesh.project(mesh, loc, field = NULL, ...)
## S3 method for class 'inla.mesh.1d'
inla.mesh.project(mesh, loc, field = NULL, ...)
|
mesh |
An |
loc |
Projection locations. |
lattice |
An |
xlim |
X-axis limits for a lattice. |
ylim |
Y-axis limits for a lattice. |
dims |
Lattice dimensions. |
projector |
An |
field |
Basis function weights, one per mesh basis function, describing the function to be avaluated at the projection locationssFunction values for on the mesh |
projection |
One of |
... |
Additional arguments passed on to methods. |
The call inla.mesh.project(mesh, loc, field=..., ...)
, is a
shortcut to inla.mesh.project(inla.mesh.projector(mesh, loc), field).
For inla.mesh.project(mesh, ...)
, a list with projection information.
For inla.mesh.projector(mesh, ...)
, an inla.mesh.projector
object.
For inla.mesh.project(projector, field, ...)
, a field projected
from the mesh onto the locations given by the projector object.
Finn Lindgren finn.lindgren@gmail.com
inla.mesh
,
inla.mesh.1d
,
inla.mesh.lattice
1 2 3 4 5 6 7 8 9 10 | n = 20
loc = matrix(runif(n*2), n, 2)
mesh = inla.mesh.create(loc, refine=list(max.edge=0.05))
proj = inla.mesh.projector(mesh)
field = cos(mesh$loc[,1]*2*pi*3)*sin(mesh$loc[,2]*2*pi*7)
image(proj$x, proj$y, inla.mesh.project(proj, field))
if (require(rgl)) {
plot(mesh, rgl=TRUE, col=field, draw.edges=FALSE, draw.vertices=FALSE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.