neighb | R Documentation |
A function to find the neighbourhood of an actor or group of actors with a customized distance.
neighb(x, rs, type = c("und", "inn", "out"), k = 1, inclx = FALSE, expand)
x |
the reference actor labeled in |
rs |
the relational system of the network |
type |
whether the system is
|
k |
the “distance” of the neighbour nodes to the reference actor (where |
inclx |
(logical) should the reference actor be included in the output? |
expand |
(optional and logical) should the output be given by |
The relational system serves to represent either the entire multiple network made of actors, or else just the relational bundles having a mutual or an asymmetric character in the system.
In this sense, this function detects the adjacent nodes to ‘x
’ according to the specified relational system, but as well the neighbours of the adjacent nodes with a customized length.
Eventually, when the longest path or chain is reached, adding more value to k
obviously will not produce more nodes in the graph system.
Type options inn
and out
are for directed networks.
Depending on expand
, the output is either a vector or a list with the neighbour nodes to the reference actor(s).
The output does not differentiate in case the reference actors are in different components of the network.
Antonio Rivero Ostoic
expos
, rel.sys
, bundles
# create the data: two binary relations among three elements
arr <- round( replace( array( runif(18), c(3 ,3, 2) ), array( runif(18),
c(3, 3, 2) ) > .9, 3 ) )
# establish the system of strong bonds
rs <- rel.sys(arr, bonds = "strong")
# obtain inmediate neighbourhood of the first node
neighb(1, rs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.