This article plays through an exemplar workflow for creating a network of mentions.

  • This can be used to try to find communities of authors who all mention one another.

We’ll use the example data in the ConnectR package.

  • Will filter it a little because mentions are numerous.
  • Will also tidy up the names of the variables we want to use.
example <- ConnectR::mention_example %>%
  dplyr::sample_n(100) %>%
  dplyr::rename(followers = `twitter followers`, reach = `estimated reach`)

Create the network

Using a variable

Radarly exports provide mentioned authors in a variable called mentions and separated by “;”

  • To use this variable, set process = "radarly" and to = mentions.
radarly_mentions <- example %>%
  ConnectR::make_mention_network(process = "radarly",
                                 from = author,
                                 to = mentions,
                                 size = followers,
                                 colour = reach)

Extracting the mentions directly

If the dataset doesn’t contain a mentions variable, then ConnectR can be used to try to extract mentions from the text itself.

  • To do this, set process = "extract" and provide the name of the text column in your data as the to = argument.
extracted_mentions <- example %>%
  ConnectR::make_mention_network(process = "extract",
                                 from = author,
                                 to = text,
                                 size = followers,
                                 colour = reach)

Visualise the network

Radarly

Interactive

The default visualisation is interactive. You can:

  • Hover over a node to highlight its connections, name, and follower count.
  • Hover over an arrow to see how many retweets it represents.
  • Zoom in or out to see all the names for a collection of nodes.
  • Use the “edit” button to remove irrelevant nodes and edges.
  • Double click on a node to collapse all its edges.
  • Click and drag the nodes to make the layout clearer.
  • Search for a particular author in the dropdown menu.
ConnectR::viz_network(tbl_graph = radarly_mentions)

Static

It’s also possible to create a static visualisation of the network in case this is necessary.

ConnectR::viz_network(tbl_graph = radarly_mentions,
                      type = "static",
                      label_prop = 0.2)

Extracted

ConnectR::viz_network(tbl_graph = extracted_mentions)