gg_wp_chart: Win Probability Charts in ggplot

Description Usage Arguments Details Examples

View source: R/gg_wp_chart.R

Description

This function creates a win probability chart over the game duration.

Usage

1
gg_wp_chart(.data, home_col, away_col, show_gei)

Arguments

.data

Play-by-play data returned from w_get_pbp_game

home_col

Color of home team for chart. Defaults to primary, with a backup if nothing is found.

away_col

Color of away team for chart. Defaults to primary, with a backup if nothing is found.

show_gei

Logical whether Game Exictement Index and Minimum Win Probability metrics should be displayed on the plot. Default = TRUE.

Details

This function takes play-by-play data returned from w_get_pbp_game and returns a ggplot2 object to show each teams win probability during the game.

Examples

1
2
pbp_data <- w_get_pbp_game("401176897")
gg_wp_chart(pbp_data)

snestler/wncaahoopR documentation built on Oct. 18, 2021, 2:11 p.m.