breakThrough: Says if there is a connected path between the boundary limits

Description Usage Arguments Value Author(s) Examples

View source: R/breakThrough.R

Description

Says if there is a connected path between the boundary limits along a given direction. Two posible directions:vertical or horizontal. Not both.

Usage

1
breakThrough(bi, lims, clust)

Arguments

bi

List with 2 integer vectors wm and wM. ID of line segments touching the study interval boundary. The result from touchBoundary.

lims

Numeric 2-dimensinal vector with the limits of the study interval.

clust

a result from graph.adjacency.

Value

A logical vector of length equals to the number of clusters. Each component answering the question: There is a connected path from lims[1] to lims[2]?

Author(s)

Daniella Ayala (daniellaayala@ciencias.unam.mx) and Francisco Mendoza-Torres (mentofran@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n <- 6; xl <- -0.3; xr <- 1.2
set.seed(123) #9
endpts <- data.frame(x0 = runif(n, xl, xr),
y0 = runif(n, xl, xr),
x1 = runif(n, xl, xr),
y1 = runif(n, xl, xr))
plotSegments(segment = endpts)
lims <- c(0,1)
abline(h=lims, v= lims, col = 'lightgray')
te <- touchBoundary(w0 = endpts$x0, w1 = endpts$x1, lims = lims)
library(igraph)
eAdjClust <- clusters(graph.adjacency(incidence.matrix(endpts)))
breakThrough(bi=te, lims=0:1, clust = eAdjClust)

mathphysmx/percolation documentation built on Aug. 14, 2019, 2:03 a.m.