| neighb | R Documentation |
A function to find with a customized distance the neighbourhood of an actor or group of actors in a relational system representing a simple or multiple network.
neighb(x, rs, type = c("und", "inn", "out"), k = 1, inclx = FALSE, expand)
x |
A reference actor labeled in |
rs |
Relational system of the network. |
type |
Type of system:
|
k |
The “distance” of the neighbour nodes to |
inclx |
(logical) Include the reference actor in the output? |
expand |
(optional and logical) Should the output be given by |
The relational system in rs represents either the full multiple network of actors or the subset of relational bundles that are mutual or asymmetric.
Accordingly, this function identifies the nodes adjacent to ‘x’ within the specified relational system, as well as neighbouring nodes at a user-defined path length.
Once the longest path or chain has been reached, increasing k will not add further nodes to the graph.
The inn and out options apply to directed networks.
Notice that the output does not differentiate in case the chosen reference actors are in different components of the relational system.
Depending on expand, the output is either a vector or a list with the neighbour nodes to the reference actor(s).
expos, rel.sys, bundles
# create 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.