View source: R/sl.elem2linepairs.R
sl.elem2linepairs | R Documentation |
Extract unique lines from elements (polygons) of an unstructured mesh. Useful for plotting to half the figure size (vector format). By default, the edges are concatenated and returned as a vector composed of segments divided by NAs.
sl.elem2linepairs(elem, concat = TRUE, verbose = FALSE)
elem |
an |
concat |
a logical value indicating whether the resulting unique edges are concatenated and returned as a vector composed of segments divided by NAs. This can be computationally advantageous, for example for line plotting. Otherwise, a two-column matrix with each row giving one pair of nodes is returned. |
verbose |
a logical value indicating whether print statements shall report on the function progess. |
If concat=TRUE
(default), the resulting unique edges are concatenated and returned as a vector composed of segments divided by NAs. Otherwise, a two-column matrix with each row giving one pair of nodes is returned.
Helge Goessling
elem = matrix(c(c(1,2,3),c(3,2,4),c(4,2,5),c(5,2,6)),ncol=3,byrow=TRUE)
sl.elem2linepairs(elem,concat=TRUE)
## Should return:
## [1] 1 2 3 4 5 6 2 4 NA 1 3 NA 2 5
sl.elem2linepairs(elem,concat=FALSE)
## Should return:
## [,1] [,2]
## [1,] 1 2
## [2,] 1 3
## [3,] 2 3
## [4,] 2 4
## [5,] 2 5
## [6,] 2 6
## [7,] 3 4
## [8,] 4 5
## [9,] 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.