Skip to contents

Convert objects to fm_lattice_2d

Usage

fm_as_lattice_2d(...)

fm_as_lattice_2d_list(x, ...)

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

# S3 method for 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

Other object creation and conversion: fm_as_fm(), fm_as_mesh_1d(), fm_as_mesh_2d(), fm_as_segm(), fm_as_sfc(), fm_as_tensor(), fm_lattice_2d(), fm_mesh_1d(), fm_mesh_2d(), fm_segm(), fm_simplify(), fm_tensor()

Examples

str(fm_as_lattice_2d_list(list(fm_lattice_2d(), fm_lattice_2d())))
#> List of 2
#>  $ :List of 6
#>   ..$ 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
#>   ..- attr(*, "class")= chr [1:2] "fm_lattice_2d" "inla.mesh.lattice"
#>  $ :List of 6
#>   ..$ 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
#>   ..- attr(*, "class")= chr [1:2] "fm_lattice_2d" "inla.mesh.lattice"
#>  - attr(*, "class")= chr [1:3] "fm_lattice_2d_list" "fm_list" "list"