Learn R Programming

fmesher (version 0.3.0)

fm_as_segm: Convert objects to fm_segm

Description

Convert objects to fm_segm

Usage

fm_as_segm(x, ...)

fm_as_segm_list(x, ...)

# S3 method for fm_segm fm_as_segm(x, ...)

# S3 method for inla.mesh.segment fm_as_segm(x, ...)

# S3 method for sfg fm_as_segm(x, ...)

# S3 method for sfc_POINT fm_as_segm(x, reverse = FALSE, grp = NULL, is.bnd = TRUE, ...)

# S3 method for sfc_LINESTRING fm_as_segm(x, join = TRUE, grp = NULL, reverse = FALSE, ...)

# S3 method for sfc_MULTILINESTRING fm_as_segm(x, join = TRUE, grp = NULL, reverse = FALSE, ...)

# S3 method for sfc_POLYGON fm_as_segm(x, join = TRUE, grp = NULL, ...)

# S3 method for sfc_MULTIPOLYGON fm_as_segm(x, join = TRUE, grp = NULL, ...)

# S3 method for sfc_GEOMETRY fm_as_segm(x, grp = NULL, join = TRUE, ...)

# S3 method for sf fm_as_segm(x, ...)

# S3 method for matrix fm_as_segm( x, reverse = FALSE, grp = NULL, is.bnd = FALSE, crs = NULL, closed = FALSE, ... )

# S3 method for SpatialPoints fm_as_segm(x, reverse = FALSE, grp = NULL, is.bnd = TRUE, closed = FALSE, ...)

# S3 method for SpatialPointsDataFrame fm_as_segm(x, ...)

# S3 method for Line fm_as_segm(x, reverse = FALSE, grp = NULL, crs = NULL, ...)

# S3 method for Lines fm_as_segm(x, join = TRUE, grp = NULL, crs = NULL, ...)

# S3 method for SpatialLines fm_as_segm(x, join = TRUE, grp = NULL, ...)

# S3 method for SpatialLinesDataFrame fm_as_segm(x, ...)

# S3 method for SpatialPolygons fm_as_segm(x, join = TRUE, grp = NULL, ...)

# S3 method for SpatialPolygonsDataFrame fm_as_segm(x, ...)

# S3 method for Polygons fm_as_segm(x, join = TRUE, crs = NULL, grp = NULL, ...)

# S3 method for Polygon fm_as_segm(x, crs = NULL, ...)

Value

An fm_segm or fm_segm_list object

Arguments

x

Object to be converted.

...

Arguments passed on to submethods

reverse

logical; When TRUE, reverse the order of the input points. Default FALSE

grp

if non-null, should be an integer vector of grouping labels for one for each segment. Default NULL

is.bnd

logical; if TRUE, set the boundary flag for the segments. Default TRUE

join

logical; if TRUE, join input segments with common vertices. Default TRUE

crs

A crs object

closed

logical; whether to treat a point sequence as a closed polygon. Default: FALSE

Functions

  • fm_as_segm(): Convert an object to fm_segm.

  • fm_as_segm_list(): Convert each element, making a fm_segm_list object

See Also

c.fm_segm(), c.fm_segm_list(), [.fm_segm_list()

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

Examples

Run this code
fm_as_segm_list(list(
  fm_segm(fmexample$mesh),
  fm_segm(fmexample$mesh, boundary = FALSE)
))

(segm <- fm_segm(fmexample$mesh, boundary = FALSE))
(segm_sfc <- fm_as_sfc(segm))
(fm_as_segm(segm_sfc))

Run the code above in your browser using DataLab