Skip to contents

Convert objects to fm_lattice_2d

Usage

fm_as_lattice_2d(...)

fm_as_lattice_2d_list(x, ...)

# S3 method for class 'fm_lattice_2d'
fm_as_lattice_2d(x, ...)

# S3 method for class 'inla.mesh.lattice'
fm_as_lattice_2d(x, ...)

Arguments

...

Arguments passed on to submethods

x

Object to be converted

Value

An fm_lattice_2d or fm_lattice_2d_list object

Functions

  • fm_as_lattice_2d(): Convert an object to fm_lattice_2d.

  • fm_as_lattice_2d_list(): Convert each element of a list

See also

Examples

str(fm_as_lattice_2d_list(list(fm_lattice_2d(), fm_lattice_2d())))
#> List of 2
#>  $ :List of 7
#>   ..$ dims: int [1:2] 2 2
#>   ..$ x   : num [1:2] 0 1
#>   ..$ y   : num [1:2] 0 1
#>   ..$ loc : num [1:4, 1:2] 0 1 0 1 0 0 1 1
#>   ..$ segm:List of 5
#>   .. ..$ loc   : num [1:4, 1:3] 0 1 1 0 0 0 1 1 0 0 ...
#>   .. ..$ idx   : int [1:4, 1:2] 1 2 3 4 2 3 4 1
#>   .. ..$ grp   : int [1:4] 1 2 3 4
#>   .. ..$ is.bnd: logi [1:4] TRUE TRUE TRUE TRUE
#>   .. ..$ crs   : NULL
#>   .. ..- attr(*, "class")= chr [1:2] "fm_segm" "inla.mesh.segment"
#>   ..$ crs : NULL
#>   ..$ crs0: NULL
#>   ..- attr(*, "class")= chr [1:2] "fm_lattice_2d" "inla.mesh.lattice"
#>  $ :List of 7
#>   ..$ dims: int [1:2] 2 2
#>   ..$ x   : num [1:2] 0 1
#>   ..$ y   : num [1:2] 0 1
#>   ..$ loc : num [1:4, 1:2] 0 1 0 1 0 0 1 1
#>   ..$ segm:List of 5
#>   .. ..$ loc   : num [1:4, 1:3] 0 1 1 0 0 0 1 1 0 0 ...
#>   .. ..$ idx   : int [1:4, 1:2] 1 2 3 4 2 3 4 1
#>   .. ..$ grp   : int [1:4] 1 2 3 4
#>   .. ..$ is.bnd: logi [1:4] TRUE TRUE TRUE TRUE
#>   .. ..$ crs   : NULL
#>   .. ..- attr(*, "class")= chr [1:2] "fm_segm" "inla.mesh.segment"
#>   ..$ crs : NULL
#>   ..$ crs0: NULL
#>   ..- attr(*, "class")= chr [1:2] "fm_lattice_2d" "inla.mesh.lattice"
#>  - attr(*, "class")= chr [1:3] "fm_lattice_2d_list" "fm_list" "list"