Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stransform

Coordinate transformation for spatial objects


Description

This is a wrapper for the spTransform function provided by the sp package. Given a spatial object (or a list thereof) it will transform the coordinate system according to the parameter crs. In addition to the usual spatial objects this function is also capables of transforming INLA::inla.mesh objects that are equipped with a coordinate system.#'

Usage

stransform(splist, crs)

Arguments

splist

list of Spatial* objects

crs

Coordinate reference system to change to

Value

List of Spatial* objects

Examples

# Load Gorilla data
data("gorillas", package = "inlabru")

# Take the mesh and transform it to latitude/longitude
tmesh <- stransform(gorillas$mesh, crs = CRS("+proj=longlat"))

# Compare original and transformed mesh

multiplot(
  ggplot() +
    gg(gorillas$mesh) +
    ggtitle("Original mesh"),
  ggplot() +
    gg(tmesh) +
    ggtitle("Transformed mesh")
)

inlabru

Bayesian Latent Gaussian Modelling using INLA and Extensions

v2.3.1
GPL (>= 2)
Authors
Finn Lindgren [aut, cre, cph] (<https://orcid.org/0000-0002-5833-2011>, Finn Lindgren continued development of the main code), Fabian E. Bachl [aut, cph] (Fabian Bachl wrote the main code), David L. Borchers [ctb, dtc, cph] (David Borchers wrote code for Gorilla data import and sampling, multiplot tool), Daniel Simpson [ctb, cph] (Daniel Simpson wrote the basic LGCP sampling method), Lindesay Scott-Howard [ctb, dtc, cph] (Lindesay Scott-Howard provided MRSea data import code), Seaton Andy [ctb] (Andy Seaton provided testing and bugfixes)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.