mayors: Find "mayors" in a network

Description Usage Arguments Examples

Description

In a social network, community-detection algorithms can be used to find cliques that are more strongly connected to each other than to the rest of the network. For each community, the "mayor" is the node with the highest influence. Finding mayors can often be a useful way of figuring out whether the community has a definable theme or group identity.

Usage

1
mayors(g, comm, n = 8, metric = page.rank, extra = NULL)

Arguments

g

An igraph graph object.

comm

An igraph communities object

n

The number of mayors to find. By default, returns mayors for the largest n communities.

metric

Function to use in determining influence within a community

extra

Additional communities whose mayors should be found.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(dplyr)
library(igraph)
g <- sample_tweets %>%
    ws_to_graph() %>%
    graph_lcc()
fg <- g %>%
    as.undirected() %>%
    simplify() %>%
    fastgreedy.community()
mayors(g,fg)

ccjolley/cRimson documentation built on May 13, 2019, 2:16 p.m.