Skip to contents

Welcome folks,

I’m Saiem Gilani, one of the authors of wehoop, and I hope to give the community a high-quality resource for accessing women’s basketball data for statistical analysis, basketball research, and more. I am excited to show you some of what you can do with this edition of the package.

Installing R and RStudio

  1. Head to https://cran.r-project.org
  2. Select the appropriate link for your operating system (Windows, Mac OS X, or Linux)
  • Windows - Select base and download the most recent version
  • Mac OS X - Select Latest Release, but check to make sure your OS is the correct version. Look through Binaries for Legacy OS X Systems if you are on an older release
  • Linux - Select the appropriate distro and follow the installation instructions
  1. Head to Posit.co
  2. Follow the associated download and installation instructions for RStudio.
  3. Start peering over the RStudio IDE Cheatsheet. An IDE is an integrated development environment.
  4. For Windows users: I recommend you install Rtools. This is not an R package! It is “a collection of resources for building packages for R under Microsoft Windows, or for building R itself”. Go to https://cran.r-project.org/bin/windows/Rtools/ and follow the directions for installation.

Install wehoop

# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
  install.packages('pacman')
}

pacman::p_load(wehoop, dplyr, glue, tictoc, progressr)

Quick Start

WNBA full play-by-play seasons (2002-2022) ~ 30-60 seconds

tictoc::tic()
progressr::with_progress({
  wnba_pbp <- wehoop::load_wnba_pbp()
})
tictoc::toc()
## 1.172 sec elapsed
## 13.91 sec elapsed
glue::glue("{nrow(wnba_pbp)} rows of WNBA play-by-play data from {length(unique(wnba_pbp$game_id))} games.")
## 92964 rows of WNBA play-by-play data from 241 games.
## 1782985 rows of WNBA play-by-play data from 4674 games.
dplyr::glimpse(wnba_pbp)
## Rows: 92,964
## Columns: 55
## $ id                              <dbl> 4013916504, 4013916507, 4013916509, 40…
## $ sequence_number                 <chr> "4", "7", "9", "12", "14", "15", "16",…
## $ type_id                         <chr> "615", "45", "615", "92", "156", "70",…
## $ type_text                       <chr> "Jumpball", "Personal Foul", "Jumpball…
## $ text                            <chr> "Queen Egbo vs. Myisha Hines-Allen (De…
## $ away_score                      <int> 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 5, 5, 7,…
## $ home_score                      <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 4,…
## $ period_number                   <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ period_display_value            <chr> "1st Quarter", "1st Quarter", "1st Qua…
## $ clock_display_value             <chr> "10:00", "9:47", "9:33", "9:31", "9:31…
## $ scoring_play                    <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FAL…
## $ score_value                     <int> 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 2, 2,…
## $ team_id                         <chr> "5", "16", "5", "5", "5", "5", "16", "…
## $ participants_0_athlete_id       <chr> "4398779", "3142055", "4398776", "4398…
## $ participants_1_athlete_id       <chr> "3142055", NA, "3146151", "3058893", N…
## $ participants_2_athlete_id       <chr> "4398751", NA, "4398751", NA, NA, NA, …
## $ shooting_play                   <lgl> FALSE, FALSE, FALSE, TRUE, FALSE, FALS…
## $ coordinate_x                    <int> -214748340, 38, -214748340, 37, 37, 32…
## $ coordinate_y                    <int> -214748365, 24, -214748365, 9, 9, 3, 0…
## $ season                          <int> 2022, 2022, 2022, 2022, 2022, 2022, 20…
## $ season_type                     <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
## $ away_team_id                    <int> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,…
## $ away_team_name                  <chr> "Indiana", "Indiana", "Indiana", "Indi…
## $ away_team_mascot                <chr> "Fever", "Fever", "Fever", "Fever", "F…
## $ away_team_abbrev                <chr> "IND", "IND", "IND", "IND", "IND", "IN…
## $ away_team_name_alt              <chr> "Indiana", "Indiana", "Indiana", "Indi…
## $ home_team_id                    <int> 16, 16, 16, 16, 16, 16, 16, 16, 16, 16…
## $ home_team_name                  <chr> "Washington", "Washington", "Washingto…
## $ home_team_mascot                <chr> "Mystics", "Mystics", "Mystics", "Myst…
## $ home_team_abbrev                <chr> "WSH", "WSH", "WSH", "WSH", "WSH", "WS…
## $ home_team_name_alt              <chr> "Washington", "Washington", "Washingto…
## $ home_team_spread                <dbl> 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5…
## $ game_spread                     <dbl> 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5…
## $ home_favorite                   <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TR…
## $ game_spread_available           <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FAL…
## $ game_id                         <int> 401391650, 401391650, 401391650, 40139…
## $ qtr                             <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ time                            <chr> "10:00", "9:47", "9:33", "9:31", "9:31…
## $ clock_minutes                   <int> 10, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 7…
## $ clock_seconds                   <dbl> 0, 47, 33, 31, 31, 31, 11, 7, 58, 44, …
## $ half                            <chr> "1", "1", "1", "1", "1", "1", "1", "1"…
## $ game_half                       <chr> "1", "1", "1", "1", "1", "1", "1", "1"…
## $ lag_qtr                         <dbl> NA, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ lead_qtr                        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ lag_game_half                   <chr> NA, "1", "1", "1", "1", "1", "1", "1",…
## $ lead_game_half                  <chr> "1", "1", "1", "1", "1", "1", "1", "1"…
## $ start_quarter_seconds_remaining <int> 600, 587, 573, 571, 571, 571, 551, 547…
## $ start_half_seconds_remaining    <int> 1200, 1187, 1173, 1171, 1171, 1171, 11…
## $ start_game_seconds_remaining    <int> 2400, 2387, 2373, 2371, 2371, 2371, 23…
## $ game_play_number                <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,…
## $ end_quarter_seconds_remaining   <dbl> 600, 600, 587, 573, 571, 571, 571, 551…
## $ end_half_seconds_remaining      <dbl> 1200, 1200, 1187, 1173, 1171, 1171, 11…
## $ end_game_seconds_remaining      <dbl> 2400, 2400, 2387, 2373, 2371, 2371, 23…
## $ period                          <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ type_abbreviation               <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…

WNBA full team box score seasons (2003-2022) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  wnba_team_box <- wehoop::load_wnba_team_box()
})

tictoc::toc()
## 0.037 sec elapsed
glue::glue("{nrow(wnba_team_box)} rows of WNBA team boxscore data from {length(unique(wnba_team_box$game_id))} games.")
## 478 rows of WNBA team boxscore data from 239 games.
dplyr::glimpse(wnba_team_box)
## Rows: 478
## Columns: 40
## $ team_id                                                        <chr> "18", "…
## $ team_uid                                                       <chr> "s:40~l…
## $ team_slug                                                      <chr> "connec…
## $ team_location                                                  <chr> "Connec…
## $ team_name                                                      <chr> "Sun", …
## $ team_abbreviation                                              <chr> "CONN",…
## $ team_display_name                                              <chr> "Connec…
## $ team_short_display_name                                        <chr> "Sun", …
## $ team_color                                                     <chr> "de6b36…
## $ team_alternate_color                                           <chr> "002d62…
## $ team_logo                                                      <chr> "https:…
## $ field_goals_made_field_goals_attempted                         <chr> "27-64"…
## $ field_goal_pct                                                 <chr> "42.2",…
## $ three_point_field_goals_made_three_point_field_goals_attempted <chr> "3-14",…
## $ three_point_field_goal_pct                                     <chr> "21.4",…
## $ free_throws_made_free_throws_attempted                         <chr> "14-21"…
## $ free_throw_pct                                                 <chr> "66.7",…
## $ total_rebounds                                                 <chr> "34", "…
## $ offensive_rebounds                                             <chr> "6", "2…
## $ defensive_rebounds                                             <chr> "28", "…
## $ assists                                                        <chr> "19", "…
## $ steals                                                         <chr> "6", "5…
## $ blocks                                                         <chr> "2", "4…
## $ turnovers                                                      <chr> "8", "7…
## $ team_turnovers                                                 <chr> "1", "1…
## $ total_turnovers                                                <chr> "9", "8…
## $ technical_fouls                                                <chr> "0", "0…
## $ total_technical_fouls                                          <chr> "0", "0…
## $ flagrant_fouls                                                 <chr> "0", "0…
## $ fouls                                                          <chr> "16", "…
## $ largest_lead                                                   <chr> "2", "2…
## $ home_away                                                      <chr> "HOME",…
## $ opponent_id                                                    <int> 17, 18,…
## $ opponent_name                                                  <chr> "Las Ve…
## $ opponent_mascot                                                <chr> "Aces",…
## $ opponent_abbrev                                                <chr> "LV", "…
## $ game_id                                                        <int> 4014556…
## $ season                                                         <int> 2022, 2…
## $ season_type                                                    <int> 3, 3, 3…
## $ game_date                                                      <date> 2022-0…

WNBA full player box score seasons (2002-2022) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  wnba_player_box <- wehoop::load_wnba_player_box()
})
tictoc::toc()
## 0.066 sec elapsed
length(unique(wnba_player_box$game_id))
## [1] 235
nrow(wnba_player_box)
## [1] 4450

Women’s college basketball full play-by-play seasons (2004-2022) ~ 45-90 seconds

tictoc::tic()
progressr::with_progress({
  wbb_pbp <- wehoop::load_wbb_pbp()
})
tictoc::toc()
## 2.496 sec elapsed
length(unique(wbb_pbp$game_id))
## [1] 772
nrow(wbb_pbp)
## [1] 265764

Women’s college basketball full team box score seasons (2006-2022) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  wbb_team_box <- wehoop::load_wbb_team_box()
})
tictoc::toc()
## 0.052 sec elapsed
length(unique(wbb_team_box$game_id))
## [1] 790
nrow(wbb_team_box)
## [1] 1580

Women’s college basketball full player box score seasons (2006-2022) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  wbb_player_box <- wehoop::load_wbb_player_box()
})
tictoc::toc()
## 0.173 sec elapsed
length(unique(wbb_player_box$game_id))
## [1] 790
nrow(wbb_player_box)
## [1] 16942