Package 'nwslR'

Title: Compiles dataset for the National Women's Soccer League (NWSL)
Description: nwslR is an R package that allows users to access datasets 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.
Authors: Arielle Dror [aut, cre], Tan Ho [ctb]
Maintainer: Arielle Dror <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1
Built: 2026-09-19 01:45:10 UTC
Source: https://github.com/nwslR/nwslR

Help Index


All available seasons

Description

All available season names to pull data

Usage

available_seasons()

All available teams

Description

All available team abbreviations to pull data

Usage

available_teams()

Loads match table

Description

Loads match table that holds all matches played between 2016-present w/ match IDs

Usage

load_matches()

Note

Most, but not all, matches in table have associated stats that you can pull by feeding match ID into load_player_match_stats or load_team_match_stats. Match start times are in East Coast USA time.


Metric definitions

Description

Data dictionary holding all definitions for metrics pulls from load_player_match_stats, load_team_match_stats, load_player_season_stats, load_team_season_stats

Usage

load_metrics()

Note

Not all metrics all available for all players, matches, teams, or seasons


Loads player level match stats

Description

Loads player level stats for a given match ID

Usage

load_player_match_stats(match_id = c())

Arguments

match_id

match id available from load_matches()

Source

www.nwslsoccer.com

See Also

See load_metrics for information about returned metrics. Not all metrics exist for a given match. Join on load_players() and load_teams().

Examples

match <- load_player_match_stats("portland-thorns-fc-vs-kansas-city-current-2022-10-29")

Loads player level season stats

Description

Loads player level season stats for a given team ID/season

Usage

load_player_season_stats(team_id, season)

Arguments

team_id

team_id available from available_teams()

season

season available from available_seasons()

Source

www.nwslsoccer.com

See Also

See load_metrics for information about returned metrics. Not all metrics exist for a given match. Join on load_players() and load_teams().

Examples

season <- load_player_season_stats(team_id = "POR", season = "2022")
short_season <- load_player_season_stats(team_id = "POR", season = "2022_NWSL_Challenge_Cup")

Loads player table

Description

Loads player table that holds player IDs for all players who have made rosters 2016-present

Usage

load_players()

Loads team level match stats

Description

Loads team level stats for a given match ID

Usage

load_team_match_stats(match_id = c())

Arguments

match_id

match id available from load_matches()

Source

www.nwslsoccer.com

See Also

See load_metrics for information about returned metrics. Not all metrics exist for a given match. Join on load_teams().

Examples

match <- load_team_match_stats("portland-thorns-fc-vs-kansas-city-current-2022-10-29")

Loads team level season stats

Description

Loads team level season stats for a given team ID/season

Usage

load_team_season_stats(team_id, season)

Arguments

team_id

team_id available from available_teams()

season

season available from available_seasons()

Source

www.nwslsoccer.com

See Also

See load_metrics for information about returned metrics. Not all metrics exist for a given match. Join on load_teams().

Examples

season <- load_team_season_stats(team_id = "POR", season = "2022")
short_season <- load_team_season_stats(team_id = "POR", season = "2022_NWSL_Challenge_Cup")

Loads team table

Description

Loads team table that holds team IDs for all teams that have played from 2016-present

Usage

load_teams()

Provides user-friendly error messages

Description

Wrapper on readr::read_csv() to create better error messages when match data does not exist

Usage

read_nwsl_data(url)

Arguments

url

url to pull file from