View source: R/aggregate.index.R

aggregate_positions | R Documentation |

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

```
aggregate_positions(tau_x, type = "sum")
```

`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. |

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'.

Scores for the index defined by the indirect relation `tau_x`

and the
used aggregation type.

David Schoch

indirect_relations, transform_relations

```
library(igraph)
library(magrittr)
data("dbces11")
# degree
dbces11 %>%
indirect_relations(type = "adjacency") %>%
aggregate_positions(type = "sum")
# closeness centrality
dbces11 %>%
indirect_relations(type = "dist_sp") %>%
aggregate_positions(type = "invsum")
# betweenness centrality
dbces11 %>%
indirect_relations(type = "depend_sp") %>%
aggregate_positions(type = "sum")
# eigenvector centrality
dbces11 %>%
indirect_relations(type = "walks", FUN = walks_limit_prop) %>%
aggregate_positions(type = "sum")
# subgraph centrality
dbces11 %>%
indirect_relations(type = "walks", FUN = walks_exp) %>%
aggregate_positions(type = "self")
```

netrankr documentation built on Aug. 20, 2023, 5:06 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.