Description Usage Arguments Value Author(s) See Also Examples
Handles transformation of various inla objects accorting to coordinate
reference systems of sp::CRS or inla.CRS class.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | inla.spTransform(x, ...)
## Default S3 method:
inla.spTransform(x, crs0, crs1,
                 passthrough=FALSE, ...)
## S3 method for class 'SpatialPoints'
inla.spTransform(x, CRSobj,
                 passthrough=FALSE, ...)
## S3 method for class 'inla.mesh.lattice'
inla.spTransform(x, CRSobj,
                 passthrough=FALSE, ...)
## S3 method for class 'inla.mesh.segment'
inla.spTransform(x, CRSobj,
                 passthrough=FALSE, ...)
## S3 method for class 'inla.mesh'
inla.spTransform(x, CRSobj,
                 passthrough=FALSE, ...)
 | 
| x | The object that should be transformed from it's current CRS to a new CRS | 
| crs0 | The source  | 
| crs1 | The target  | 
| CRSobj | The target  | 
| passthrough | default FALSE. Setting to TRUE allows objects with no CRS information to be passed through without transformation. | 
| ... | Potential additional arguments | 
The object is returned with its coordinates transformed
Finn Lindgren <finn.lindgren@gmail.com>
| 1 2 3 4 5 6 7 8 | if (require(rgdal)) {
  latt <- inla.mesh.lattice(-10:10, 40:60)
  mesh1 <- inla.mesh.create(lattice=latt, extend=FALSE, refine=FALSE,
                            crs=inla.CRS("longlat"))
  mesh2 <- inla.spTransform(mesh1, inla.CRS("lambert"))
  summary(mesh1)
  summary(mesh2)
}
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.