Skip to contents

Returns the neighborhood clustering (i.e., local transitivity or local clustering coefficient) for all or a subset of nodes in the language network.

Usage

get_neighbor_clustering(network, node_name = NULL)

Arguments

network

An igraph network object, generated by make_network() or make_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.

Value

A named numeric vector.

Examples

# Use the demo data for executing examples

  test <- make_network(sample1)
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |==============================================================        |  89%
  get_neighbor_clustering(network = test) # all nodes
#>     cat     bat     cut     cap     hat    chat    heat    hate spinach 
#>     0.2     1.0     0.0     0.0     0.2     1.0     0.0     0.0     0.0 
  get_neighbor_clustering(network = test, node_name = "cat") # for 1 node
#> cat 
#> 0.2