
Returns the neighborhood size (i.e., degree) for all or a subset of nodes in the language network.
get_neighbor_size.RdReturns the neighborhood size (i.e., degree) for all or a subset of nodes in the language network.
Arguments
- network
An
igraphnetwork object, generated bymake_network()ormake_network_sep()functions.- node_name
A vector containing node names to obtain values for. Node names must be found in
igraph::V(network)$name. If unspecified, the default is to return values for all nodes in the network.
Examples
# Use the demo data for executing examples
test <- make_network(sample1)
#>
|
| | 0%
|
|======== | 11%
|
|================ | 22%
|
|======================= | 33%
|
|=============================== | 44%
|
|======================================= | 56%
|
|=============================================== | 67%
|
|====================================================== | 78%
|
|============================================================== | 89%
get_neighbor_size(network = test) # all nodes
#> cat bat cut cap hat chat heat hate spinach
#> 5 2 1 1 5 2 1 1 0
get_neighbor_size(network = test, node_name = "cat") # for 1 node
#> cat
#> 5