Learn R Programming

multiplex (version 2.3)

neighb: Neighborhood of an actor or group of actors

Description

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

Usage

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

Arguments

x
the reference actor labeled in rs or a vector of several actors
rs
the relational system of the network
type
whether the network is undirected (default) und; directed with incoming node's ties inn to the the reference actor, or else with outgoing arcs out
inclx
(logical) should the reference actor be included in the output
k
the ``distance'' of the neighbor nodes to the reference actor (where k=1 gives the adjacent nodes)
expand
(logical) should the output be given by k (it only makes sense when k>1)

Value

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

Details

The relational system serves to represent either the entire multiple network, or else just the relational bundles having a mutual or an asymmetric character. 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.

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 ) )

## Determine the system of strong bonds
rs <- rel.sys(arr, bonds = "strong")

## the inmediate neighbourhood of the first node
neighb(1, rs)

Run the code above in your browser using DataLab