community_plot: Plot network, highlighting communities

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. This generates a plot similar to sma_plot(), except that the largest communities in the network are highlighted.

Usage

1
2
community_plot(g, c, n = 8, layout = NULL, showMayors = TRUE,
  extra = NULL)

Arguments

g

An igraph graph object.

c

An igraph communities object.

n

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

layout

Results of an igraph layout routine. (layout.fruchterman.reingold is called if nothing is passed). Because these calculations can be time consuming, it makes sense to obtain the layout in advance if you'll be making several versions of the same plot.

showMayors

If true, highlight the location of mayors for the communities shown.

extra

Additional communities that should be highlighted.

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()
community_plot(g,fg)

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