aggregate_positions: Quantification of (indirect) relations

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/aggregate.index.R

Description

Function to aggregate positions defined via indirect relations to construct centrality scores.

Usage

1
aggregate_positions(tau_x, type = "sum")

Arguments

tau_x

Numeric matrix containing indirect relations calculated with indirect_relations.

type

String indicating the type of aggregation to be used. See Details for options.

Details

The predefined functions are mainly wrappers around base R functions. type='sum', for instance, is equivalent to rowSums(). A non-base functions is type='invsum' which calculates the inverse of type='sum'. type='self' is mostly useful for walk based relations, e.g. to count closed walks. Other self explanatory options are type='mean', type='min', type='max' and type='prod'.

Value

Scores for the index defined by the indirect relation tau_x and the used aggregation type.

Author(s)

David Schoch

See Also

indirect_relations, transform_relations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(igraph)
library(magrittr)

g <- graph.empty(n=11,directed = FALSE)
g <- add_edges(g,c(1,11,2,4,3,5,3,11,4,8,5,9,5,11,6,7,6,8,
                   6,10,6,11,7,9,7,10,7,11,8,9,8,10,9,10))
#degree
g %>% indirect_relations(type='adjacency') %>% 
 aggregate_positions(type='sum')

#closeness centrality
g %>% indirect_relations(type='dist_sp') %>% 
  aggregate_positions(type='invsum')
  
#betweenness centrality
g %>% indirect_relations(type='depend_sp') %>% 
  aggregate_positions(type='sum')
  
#eigenvector centrality
g %>% indirect_relations(type='walks',FUN=walks_limit_prop) %>% 
  aggregate_positions(type='sum')

#subgraph centrality
g %>% indirect_relations(type='walks',FUN=walks_exp) %>% 
  aggregate_positions(type='self')
  

netrankr documentation built on May 2, 2019, 3:30 p.m.