nwslR

Lifecycle: experimental CRAN status Travis build status

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

nwslR

nwslR is an R package that contains datasets and analysis functionality for the National Women’s Soccer League (NWSL). Founded in 2013, the NWSL is the United States’ top professional women’s soccer league, featuring players from all over the world. Previously, data regarding the league has been disparate and often difficult to find. The goal of this package is to make it easier for fans and analysts to access and engage with all these data in one place. We're just getting started here; we still have a few issues open where we could use some help! Additionally, if you see anything you'd like added, changed, or updated, please open up a new issue of your own.

This package is currently in the process of changing and updating significantly, so it is suggested that you frequently update it so that you have access to the most recent version.

Install

You can install the current version of nwslR from GitHub using:

devtools::install_github("adror1/nwslR")

Load

library(nwslR)

Available Tables

Example: Player Statistics

head(nwslR::fieldplayer_overall_season_stats)

Example: Team IDs

head(nwslR::franchise, 15)

Functionality

adv_team_stats #scraped and formatted dataset of hundreds of advanced team statistics from the NWSL website
adv_player_stats #scraped and formatted dataset of hundreds of advanced player statistics from the NWSL website

The above data tables will eventually be deprecated. Please use the functions before, instead.

To use this function, you need to find the game_id for a given game.

These are available in the game table (updated periodically throughout the season) or by looking on the NWSL website.

get_adv_team_stats("utah-royals-vs-washington-spirit-2019-04-20")
get_adv_player_stats("utah-royals-vs-washington-spirit-2019-04-20")
get_events("utah-royals-vs-washington-spirit-2019-04-20")
harris <- nwslR::player_search("Harris", goalkeeper = TRUE)
head(harris)

For further examples and capabilities, please see the vignette

Contributors



adror1/nwslR documentation built on Oct. 4, 2022, 3:06 a.m.