Inclusion of the neighbourhoods of the rows of an incidence matrix.
Details
The neighbourhoods of the rows can be defined on any set of columns (e.g. papers of authors, or
events of actors). N contains the neighbourhood that should be included, and M the
neighbourhood in which it should be included. M is the same as N for open
neighbourhoods, or can add other elements, such as the node itself, for closed neighbourhoods.
With proper = TRUE the inclusion should be proper, \(N(u) \subsetneq M(v)\), i.e.
\(M(v)\) has at least one element that is not in \(N(u)\).
Examples
X <- matrix(c(
1, 1, 1, 0,
1, 1, 0, 0,
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 1
), byrow = TRUE, ncol = 4)
rownames(X) <- c("a1", "a2", "a3", "a4", "a5")
colnames(X) <- c("w1", "w2", "w3", "w4")
set_inclusion(X)
#> a1 a2 a3 a4 a5
#> a1 0 0 0 0 0
#> a2 1 0 0 0 0
#> a3 1 1 0 0 0
#> a4 1 1 0 0 0
#> a5 0 0 0 0 0
