CRSargs.RdWrapper for sp::CRS and inla.CRS objects to extract the
coordinate reference system argument string.
'r lifecycle::badge("deprecated")` in favour of fmesher::fm_proj4string(),
or fmesher::fm_wkt() for WKT2 representations.
inla.CRSargs(x, ...)
inla.as.CRSargs.list(x, ...)
inla.as.list.CRSargs(x, ...)
inla.as.list.CRS(x, ...)
inla.as.CRS.list(x, ...)An sp::CRS or inla.CRS object (for
inla.CRSargs and inla.as.list.CRS), a character string (for
inla.as.list.CRSargs), or a list (for inla.as.CRS.list and
inla.as.CRSargs.list).
Additional arguments passed on to other methods.
For inla.CRSargs and inla.as.CRSargs.list, a character
string with PROJ.4 arguments.
For inla.as.list.CRS and inla.as.list.CRSargs, a list of
name/value pairs.
For inla.as.CRS.list, a CRS or inla.CRS object.
inla.as.CRSargs.list: CRS proj4 string for name=value pair list
inla.as.list.CRSargs: List of name=value pairs from CRS proj4 string
if (require("sf") && require("sp") && require("fmesher")) {
crs0 <- fm_CRS("longlat_norm")
p4s <- fm_proj4string(crs0)
lst <- inla.as.list.CRSargs(p4s)
crs1 <- inla.as.CRS.list(lst)
lst$a <- 2
crs2 <- fm_CRS(p4s, args = lst)
print(fm_proj4string(crs0))
print(fm_proj4string(crs1))
print(fm_proj4string(crs2))
}
#> Loading required package: sf
#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
#> Loading required package: sp
#> Loading required package: fmesher
#> [1] "+proj=longlat +R=1 +no_defs"
#> [1] "+proj=longlat +R=1 +no_defs"
#> [1] "+proj=longlat +R=1 +no_defs"