get_events: Advanced player-level statistics for each game

View source: R/get_events.R

get_eventsR Documentation

Advanced player-level statistics for each game

Description

Scrapes NWSL website to pull player stats for each game. Returns a data frame with one row per shooting action in a game, including own goals. More actions coming soon.

Usage

get_events(game_id)

Arguments

game_id

Unique game id from nwsl. Find these on the NWSL website (ex: https://www.nwslsoccer.com/game/washington-spirit-vs-sky-blue-2019-04-13) or in the game table.

Details

The columns returned from the get_events function are as follows:

  • "game_id" - unique identifer for each game

  • "team" - team ID for the team that is involved in the event

  • "minute" - minute of play

  • "period" - period of play

  • "second" - second of play

  • "time" - time on match clock

  • "play_status" - state of game during event (i.e. open play, corner, set piece, etc.)

  • "result" - result of the shooting event (i.e. goal, attempted saved, miss, etc.)

  • "shot_type" - type of shot (i.e. left-footed, right-footed, header)

  • "shot_player_name - name of player who takes the shot

  • "assist_type" - type of assist, if applicable (i.e. through ball, cross, etc.)

  • "assist_player_name" - name of player who provides assist, if applicable

  • "shot_location" - location on the pitch of shot

  • "shot_on_goal_location - shot placement in goal, if applicable

  • "goal" - binary variable that denotes if action results in a goal

  • "shot" - binary variable that denotes if event is a shot

  • "shot_on_goal" - binary variable that denotes if action results in a shot on goal

  • "own_goal - binary variable that denotes if event is an own goal

  • "action" - full description of event


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