Description Usage Format References Examples
A list of two datasets, vertices and edges, containing data on Division I college football games in the Fall 2000 season. The variables are as follows:
1 |
A list of two data frames:
the edges data set consists of three variables of length 613:
from, to: Character variables describing the teams playing in the game
same.conf: An indicator variable that is 1 if the two teams are in the same conference and 0 otherwise.
the vertices data set consists of two variables with information on 115 Division I schools:
label: Character variable containing the school names
value: Character variable containing the conference of the schools
M. Girvan and M. E. J. Newman, Proc. Natl. Acad. Sci. USA 99, 7821-7826 (2002).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # data step: merge vertices and edges
ftnet <- merge(
football$edges, football$vertices,
by.x = "from", by.y = "label", all = TRUE
)
# label independent schools
ftnet$schools <- ifelse(ftnet$value == "Independents", ftnet$from, "")
library(geomnet)
library(dplyr)
# create data plot
ggplot(data = ftnet,
aes(from_id = from, to_id = to)) +
geom_net(
aes(
colour = value, group = value,
linetype = factor(1-same.conf),
label = schools
),
linewidth = 0.5,
size = 5, vjust = -0.75, alpha = 0.3,
layout.alg = 'fruchtermanreingold'
) +
theme_net() +
theme(legend.position = "bottom") +
scale_colour_brewer("Conference", palette = "Paired")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.