Learn R Programming

multiplex (version 3.7)

neighb: Neighborhood of Actor or Group of Actors

Description

A function to find the neighbourhood of an actor or group of actors with a customized distance.

Usage

neighb(x, rs, type = c("und", "inn", "out"), k = 1, inclx = FALSE, expand)

Value

Depending on expand, the output is either a vector or a list with the neighbour nodes to the reference actor(s).

Arguments

x

the reference actor labeled in rs or a vector of several actors

rs

the relational system of the network

type

whether the system is

  • und for undirected (default)

  • inn for incoming node's ties to the reference actor

  • out for outgoing arcs from the reference actor

k

the “distance” of the neighbour nodes to the reference actor (where k=1 gives the adjacent nodes)

inclx

(logical) should the reference actor be included in the output?

expand

(optional and logical) should the output be given by k (it only makes sense when k>1)

Author

Antonio Rivero Ostoic

Details

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.

See Also

expos, rel.sys, bundles

Examples

Run this code
# 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)

Run the code above in your browser using DataLab