Skip to contents

This function assigns colors to the network nodes based on their centrality measurements.

Usage

ctr_g (g, ctr_type)

Arguments

g

An igraph object.

ctr_type

Centrality type ("degree", "betweenness" or "closeness").

Value

An igraph object with colored nodes.

Examples


data ("net_dstoolA")
ctr_g (net_dstoolA, ctr_type = "degree")
#> IGRAPH 2d45ded UN-- 152 4 -- 
#> + attr: name (v/c), hl (v/c)
#> + edges from 2d45ded (vertex names):
#> [1] Tsukamurellaceae   --Gallionellaceae                              
#> [2] Hyphomonadaceae    --Armatimonadaceae                             
#> [3] Alicyclobacillaceae--ACK-M1                                       
#> [4] Nitrospiraceae     --ThermoanaerobacteralesFamilyIII.IncertaeSedis
ctr_g (net_dstoolA, ctr_type = "closeness")
#> IGRAPH 2d45ded UN-- 152 4 -- 
#> + attr: name (v/c), hl (v/c)
#> + edges from 2d45ded (vertex names):
#> [1] Tsukamurellaceae   --Gallionellaceae                              
#> [2] Hyphomonadaceae    --Armatimonadaceae                             
#> [3] Alicyclobacillaceae--ACK-M1                                       
#> [4] Nitrospiraceae     --ThermoanaerobacteralesFamilyIII.IncertaeSedis

data ("net_dstoolB")
ctr_g (net_dstoolB, ctr_type = "betweenness")
#> IGRAPH 6e2239b UN-- 152 17 -- 
#> + attr: name (v/c), hl (v/c)
#> + edges from 6e2239b (vertex names):
#>  [1] Acidobacteriaceae --Sinobacteraceae   
#>  [2] Oceanospirillaceae--Bacteriovoracaceae
#>  [3] Oceanospirillaceae--Methylophilaceae  
#>  [4] Bacteriovoracaceae--Methylophilaceae  
#>  [5] Oceanospirillaceae--Methylocystaceae  
#>  [6] Bacteriovoracaceae--Methylocystaceae  
#>  [7] Methylophilaceae  --Methylocystaceae  
#>  [8] Acidobacteriaceae --Streptomycetaceae 
#> + ... omitted several edges
ctr_g (net_dstoolB, ctr_type = "degree")
#> IGRAPH 6e2239b UN-- 152 17 -- 
#> + attr: name (v/c), hl (v/c)
#> + edges from 6e2239b (vertex names):
#>  [1] Acidobacteriaceae --Sinobacteraceae   
#>  [2] Oceanospirillaceae--Bacteriovoracaceae
#>  [3] Oceanospirillaceae--Methylophilaceae  
#>  [4] Bacteriovoracaceae--Methylophilaceae  
#>  [5] Oceanospirillaceae--Methylocystaceae  
#>  [6] Bacteriovoracaceae--Methylocystaceae  
#>  [7] Methylophilaceae  --Methylocystaceae  
#>  [8] Acidobacteriaceae --Streptomycetaceae 
#> + ... omitted several edges