A list of two datasets, vertices and edges, containing data on characters and their coapperance in chapters in Victor Hugo's Les Miserables. The variables are as follows:
A list of two data frames:
the edges data set consists of three variables of length 254:
from: Character 1
to: Character 2
degree: number of times they appear together in a chapter of Les Miserables
the vertices data set consists of two variables with information on 77 characters:
id: Character ID number
label: Character name
D. E. Knuth, The Stanford GraphBase: A Platform for Combinatorial Computing, Addison-Wesley, Reading, MA (1993).
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.