Neighborhood of an actor or group of actors

Share:

Description

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

Usage

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

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.

Value

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

Note

In case that the reference actors are in different components of the network, the output does not discriminate this fact.

Author(s)

Antonio Rivero Ostoic

See Also

expos, rel.sys, bundles

Examples

1
2
3
4
5
6
7
8
9
## 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.