sma_plot: Draw a network, highlighting key influencers

Description Usage Arguments Examples

Description

This function draws a (potentially large) social network. A metric function (by default igraph::page.rank) is used to identify up to eight top influencers, and these are highlighted by edge coloring.

Usage

1
sma_plot(g, n = 8, highlight = NULL, layout = NULL, extra = NULL)

Arguments

g

An igraph graph object.

n

Number of nodes to highlight. The maximum value (8) is set by the number of colors available from RColorBrewer.

highlight

The results of a scoring function according to which highlighted nodes should be chosen. Calls igraph::page.rank() if nothing is passed. Calculating the scoring in advance lets you economize if you'll be using the same scoring function for an sma_plot() call and an sma_bar() call.

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.

extra

A list of node names to be highlighted in addition to the top-ranked ones.

Examples

1
2
3
4
5
library(dplyr)
sample_tweets %>%
    ws_to_graph() %>%
    graph_lcc() %>%
    sma_plot()

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