lesmis: Co-appearance network of characters in Les Miserables...

Description Usage Format References Examples

Description

A list of two datasets, vertices and edges, containing data on characters and their co-appearance in chapters in Victor Hugo's Les Miserables. The variables are as follows:

Usage

1

Format

A list of two data frames:

References

D. E. Knuth, The Stanford GraphBase: A Platform for Combinatorial Computing, Addison-Wesley, Reading, MA (1993).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# prep the data
lesmisnet <- merge(lesmis$edges, lesmis$vertices, by.x = "from",
                   by.y = "label", all = TRUE)
lesmisnet$degree[is.na(lesmisnet$degree)] <- 0

# create plot
library(geomnet)
library(dplyr)

ggplot(data = lesmisnet, aes(from_id = from, to_id = to,
                             linewidth = degree / 5 + 0.1 )) +
  geom_net(aes(size = degree, alpha = degree),
           colour = "grey30", ecolour = "grey60",
           layout.alg = "fruchtermanreingold", labelon = TRUE, vjust = -0.75) +
  scale_alpha(range = c(0.3, 1)) +
  theme_net()

Example output

Loading required package: ggplot2

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

geomnet documentation built on Nov. 26, 2020, 5:07 p.m.