Learn R Programming

geomnet (version 0.3.1)

soccer: High school boys' soccer games in Iowa (undirected)

Description

A list of two datasets, vertices and edges, containing data on boys' soccer games at Iowa high schools in the 2011-2014 seasons. This dataset was compiled by Danny Bero (bero.danny@gmail.com). The variables are as follows:

Usage

soccer

Arguments

Format

A list of two data frames:

  • the edges data set consists of 11 variables of length 4484:

    • sub: Integer variable with the subregion of the state the school is in (1-8)

    • home: Factor variable containing the home team school

    • season: Integer variable with the year the game was played

    • week: Integer variable with the week of the season the game was played

    • date: Factor variable containing the date the game was played

    • away: Factor variable containing the away team school

    • ha: Factor variable stating if the first team is the home team, away team, or neutral?

    • result: Factor variable stating if the home team won, lost, or tied?

    • score: Factor variable with game final score, home team first

    • diff: Integer variable with home team score minus away team score

    • same_div: An indicator variable that is 1 if the schools are in the same division and 0 otherwise

  • the vertices data set consists of two variables with information on 157 schools:

    • div: Factor variable with division school is in (1, 2, or 3A)

    • label: Factor variable with school name

Examples

Run this code
# NOT RUN {
# prep the data
soccernet <- merge(soccer$edges, soccer$vertices, by.x = "home",
                   by.y = "label", all = TRUE)
library(geomnet)
library(dplyr)
# create plot
ggplot(data = soccernet, aes(from_id = home, to_id = away)) +
  geom_net(aes(colour = div, group = div), ealpha = .25,
           layout.alg = 'fruchtermanreingold') +
  facet_wrap(~season) +
  theme_net()
# }

Run the code above in your browser using DataLab