Skip to contents

Welcome folks,

I’m Saiem Gilani, one of the authors of hoopR, and I hope to give the community a high-quality resource for accessing men’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 RStudio.com
  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 hoopR

# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
  install.packages('pacman')
}
pacman::p_load_current_gh("saiemgilani/hoopR", dependencies = TRUE, update = TRUE)

pacman::p_load(tidyverse, zoo, ggimage, gt)

The Data

There are generally speaking five men’s basketball data sources accessed from this package:

Function names indicate the data source
  • Functions that use the hoopR-data repository will contain load_ or update_ in the function name and would be considered loading functions for the play-by-play data, team box scores, and player box scores.

  • Functions that use the NBA Stats API start with nba_ by convention and should be assumed as get functions. As of hoopR version 1.8.1, the package exports 127 functions covering the NBA Stats API

  • Functions that use the NBA G-League Stats API start with nbagl_ by convention and should be assumed as get functions. As of hoopR version 1.8.1, the package exports 4 functions covering the NBA G-League Stats API

  • Functions that use one of ESPN’s APIs start with espn_ by convention and should be assumed as get functions. These functions allow for live access to game data for both men’s college basketball and the NBA. As of hoopR version 1.8.1, the package exports 10 functions covering the men’s college basketball endpoints and 10 for the NBA.

  • Functions that use Ken Pomeroy’s college basketball website start with kp_ by convention and should be assumed as get functions. These functions allow users with an active subscription to get access to the data in a tidy format. As of hoopR version 1.8.1, the package exports 36 functions covering the KenPom.com.

  • Functions that use the NCAA website start with ncaa_ by convention and should be assumed as get functions. As of hoopR version 1.8.1, the package exports 1 function(s) covering the NCAA website, namely the function to access current NET rankings.

Quick Start

For the sake of your R session, we will only look at the previous 5 years of data, but I have indicated the years to which the data goes back to. ### NBA play-by-plays (2002-2021) ~ 60-120 seconds

tictoc::tic()
progressr::with_progress({
  nba_pbp <- hoopR::load_nba_pbp(2016:2021)
})
tictoc::toc()
## 40.286 sec elapsed
glue::glue("{nrow(nba_pbp)} rows of nba play-by-play data from {length(unique(nba_pbp$game_id))} games.")
## 3743046 rows of nba play-by-play data from 8040 games.
dplyr::glimpse(nba_pbp)
## Rows: 3,743,046
## Columns: 55
## $ shooting_play                   <lgl> FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, …
## $ sequence_number                 <chr> "1", "2", "3", "5", "6", "8", "9", "10…
## $ period_display_value            <chr> "1st Quarter", "1st Quarter", "1st Qua…
## $ period_number                   <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ home_score                      <int> 0, 0, 0, 0, 2, 2, 2, 2, 2, 4, 4, 4, 4,…
## $ coordinate_x                    <int> 25, 23, 25, 37, 33, 13, 25, 17, 25, 9,…
## $ coordinate_y                    <int> -8, -1, -8, 7, 10, 16, -8, 3, -8, -1, …
## $ scoring_play                    <lgl> FALSE, FALSE, FALSE, TRUE, TRUE, FALSE…
## $ clock_display_value             <chr> "12:00", "11:41", "11:38", "11:21", "1…
## $ team_id                         <chr> "1", "8", "1", "8", "1", "1", "8", "8"…
## $ type_id                         <chr> "11", "110", "155", "132", "132", "92"…
## $ type_text                       <chr> "Jump Ball", "Driving Layup Shot", "De…
## $ away_score                      <int> 0, 0, 0, 2, 2, 4, 4, 4, 4, 4, 5, 5, 5,…
## $ id                              <dbl> 4008278881, 4008278882, 4008278883, 40…
## $ text                            <chr> "Andre Drummond vs. Al Horford (Ersan …
## $ score_value                     <int> 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ participants_0_athlete_id       <chr> "3213", "6585", "6637", "6462", "3015"…
## $ participants_1_athlete_id       <chr> "6585", "3213", NA, "6585", "2011", NA…
## $ participants_2_athlete_id       <chr> "2767", NA, NA, NA, NA, NA, NA, NA, NA…
## $ season                          <int> 2016, 2016, 2016, 2016, 2016, 2016, 20…
## $ season_type                     <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
## $ away_team_id                    <int> 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,…
## $ away_team_name                  <chr> "Detroit", "Detroit", "Detroit", "Detr…
## $ away_team_mascot                <chr> "Pistons", "Pistons", "Pistons", "Pist…
## $ away_team_abbrev                <chr> "DET", "DET", "DET", "DET", "DET", "DE…
## $ away_team_name_alt              <chr> "Detroit", "Detroit", "Detroit", "Detr…
## $ home_team_id                    <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ home_team_name                  <chr> "Atlanta", "Atlanta", "Atlanta", "Atla…
## $ home_team_mascot                <chr> "Hawks", "Hawks", "Hawks", "Hawks", "H…
## $ home_team_abbrev                <chr> "ATL", "ATL", "ATL", "ATL", "ATL", "AT…
## $ home_team_name_alt              <chr> "Atlanta", "Atlanta", "Atlanta", "Atla…
## $ home_team_spread                <dbl> 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,…
## $ game_spread                     <dbl> -7, -7, -7, -7, -7, -7, -7, -7, -7, -7…
## $ home_favorite                   <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TR…
## $ game_spread_available           <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TR…
## $ game_id                         <int> 400827888, 400827888, 400827888, 40082…
## $ qtr                             <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ time                            <chr> "12:00", "11:41", "11:38", "11:21", "1…
## $ clock_minutes                   <int> 12, 11, 11, 11, 11, 10, 10, 10, 10, 9,…
## $ clock_seconds                   <dbl> 0, 41, 38, 21, 0, 26, 25, 12, 11, 41, …
## $ 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> 720, 701, 698, 681, 660, 626, 625, 612…
## $ start_half_seconds_remaining    <int> 1320, 1301, 1298, 1281, 1260, 1226, 12…
## $ start_game_seconds_remaining    <int> 2520, 2501, 2498, 2481, 2460, 2426, 24…
## $ game_play_number                <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,…
## $ end_quarter_seconds_remaining   <dbl> 600, 720, 701, 698, 681, 660, 626, 625…
## $ end_half_seconds_remaining      <dbl> 1200, 1320, 1301, 1298, 1281, 1260, 12…
## $ end_game_seconds_remaining      <dbl> 2400, 2520, 2501, 2498, 2481, 2460, 24…
## $ period                          <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ type_abbreviation               <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…

NBA team box scores (2002-2021) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  nba_team_box <- hoopR::load_nba_team_box(2016:2021)
})

tictoc::toc()
## 1.605 sec elapsed
glue::glue("{nrow(nba_team_box)} rows of NBA team boxscore data from {length(unique(nba_team_box$game_id))} games.")
## 16124 rows of NBA team boxscore data from 8062 games.
dplyr::glimpse(nba_team_box)
## Rows: 16,124
## Columns: 43
## $ team_short_display_name                                        <chr> "Piston…
## $ team_uid                                                       <chr> "s:40~l…
## $ team_alternate_color                                           <chr> "006bb6…
## $ team_color                                                     <chr> "FA002C…
## $ team_display_name                                              <chr> "Detroi…
## $ team_name                                                      <chr> "Piston…
## $ team_logo                                                      <chr> "https:…
## $ team_location                                                  <chr> "Detroi…
## $ team_id                                                        <chr> "8", "1…
## $ team_abbreviation                                              <chr> "DET", …
## $ team_slug                                                      <chr> "detroi…
## $ field_goals_made_field_goals_attempted                         <chr> "37-96"…
## $ field_goal_pct                                                 <chr> "38.5",…
## $ three_point_field_goals_made_three_point_field_goals_attempted <chr> "12-29"…
## $ three_point_field_goal_pct                                     <chr> "41.4",…
## $ free_throws_made_free_throws_attempted                         <chr> "20-26"…
## $ free_throw_pct                                                 <chr> "76.9",…
## $ total_rebounds                                                 <chr> "69", "…
## $ offensive_rebounds                                             <chr> "23", "…
## $ defensive_rebounds                                             <chr> "36", "…
## $ assists                                                        <chr> "23", "…
## $ steals                                                         <chr> "5", "9…
## $ blocks                                                         <chr> "3", "4…
## $ turnovers                                                      <chr> "15", "…
## $ team_turnovers                                                 <chr> "0", "0…
## $ total_turnovers                                                <chr> "15", "…
## $ technical_fouls                                                <chr> "0", "0…
## $ total_technical_fouls                                          <chr> "0", "0…
## $ flagrant_fouls                                                 <chr> "0", "0…
## $ turnover_points                                                <chr> "19", "…
## $ fast_break_points                                              <chr> "10", "…
## $ points_in_paint                                                <chr> "36", "…
## $ fouls                                                          <chr> "15", "…
## $ largest_lead                                                   <chr> "19", "…
## $ home_away                                                      <chr> "HOME",…
## $ opponent_id                                                    <int> 1, 8, 4…
## $ opponent_name                                                  <chr> "Atlant…
## $ opponent_mascot                                                <chr> "Hawks"…
## $ opponent_abbrev                                                <chr> "ATL", …
## $ game_id                                                        <int> 4008278…
## $ season                                                         <int> 2016, 2…
## $ season_type                                                    <int> 2, 2, 2…
## $ game_date                                                      <date> 2015-1…

NBA player box scores (2002-2021) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  nba_player_box <- hoopR::load_nba_player_box(2016:2021)
})
tictoc::toc()
## 3.008 sec elapsed
glue::glue("{nrow(nba_player_box)} rows of NBA player boxscore data from {length(unique(nba_player_box$game_id))} games.")
## 174366 rows of NBA player boxscore data from 8064 games.
dplyr::glimpse(nba_player_box)
## Rows: 174,366
## Columns: 35
## $ athlete_display_name          <chr> "Ersan Ilyasova", "Marcus Morris Sr.", "…
## $ team_short_display_name       <chr> "Pistons", "Pistons", "Pistons", "Piston…
## $ min                           <chr> "34", "37", "37", "32", "37", "24", "11"…
## $ fg                            <chr> "6-12", "6-19", "6-16", "4-10", "7-14", …
## $ fg3                           <chr> "3-6", "1-4", "0-0", "2-4", "4-7", "1-3"…
## $ ft                            <chr> "1-2", "5-6", "6-10", "5-5", "3-3", "0-0…
## $ oreb                          <chr> "3", "5", "8", "1", "1", "3", "1", "0", …
## $ dreb                          <chr> "4", "5", "11", "7", "3", "1", "4", "0",…
## $ reb                           <chr> "7", "10", "19", "8", "4", "4", "5", "0"…
## $ ast                           <chr> "3", "4", "3", "5", "1", "3", "0", "4", …
## $ stl                           <chr> "0", "0", "1", "2", "1", "0", "0", "1", …
## $ blk                           <chr> "1", "0", "2", "0", "0", "0", "0", "0", …
## $ to                            <chr> "3", "0", "2", "2", "2", "1", "1", "3", …
## $ pf                            <chr> "4", "1", "4", "0", "1", "1", "2", "1", …
## $ plus_minus                    <chr> "+20", "+17", "+23", "+26", "+17", "-13"…
## $ pts                           <chr> "16", "18", "18", "15", "21", "7", "6", …
## $ starter                       <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FAL…
## $ ejected                       <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ did_not_play                  <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ active                        <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FAL…
## $ athlete_jersey                <chr> "77", "8", "2", "1", "1", "5", "46", "22…
## $ athlete_id                    <chr> "2767", "6462", "6585", "6443", "2581018…
## $ athlete_short_name            <chr> "E. Ilyasova", "M. Morris Sr.", "A. Drum…
## $ athlete_headshot_href         <chr> "https://a.espncdn.com/i/headshots/nba/p…
## $ athlete_position_name         <chr> "Power Forward", "Small Forward", "Cente…
## $ athlete_position_abbreviation <chr> "PF", "SF", "C", "PG", "SG", "SF", "C", …
## $ team_name                     <chr> "Pistons", "Pistons", "Pistons", "Piston…
## $ team_logo                     <chr> "https://a.espncdn.com/i/teamlogos/nba/5…
## $ team_id                       <chr> "8", "8", "8", "8", "8", "8", "8", "8", …
## $ team_abbreviation             <chr> "DET", "DET", "DET", "DET", "DET", "DET"…
## $ team_color                    <chr> "FA002C", "FA002C", "FA002C", "FA002C", …
## $ game_id                       <int> 400827888, 400827888, 400827888, 4008278…
## $ season                        <int> 2016, 2016, 2016, 2016, 2016, 2016, 2016…
## $ season_type                   <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2…
## $ game_date                     <date> 2015-10-28, 2015-10-28, 2015-10-28, 201…

Men’s college basketball play-by-plays (2006-2021) ~ 120-180 seconds

tictoc::tic()
progressr::with_progress({
  mbb_pbp <- hoopR::load_mbb_pbp(2016:2021)
})
tictoc::toc()
## 112.227 sec elapsed
glue::glue("{nrow(mbb_pbp)} rows of men's college basketball play-by-play data from {length(unique(mbb_pbp$game_id))} games.")
## 10135443 rows of men's college basketball play-by-play data from 30950 games.
dplyr::glimpse(mbb_pbp)
## Rows: 10,135,443
## Columns: 54
## $ shooting_play                   <lgl> FALSE, TRUE, TRUE, FALSE, TRUE, FALSE,…
## $ sequence_number                 <chr> "101799901", "101805901", "101808001",…
## $ period_display_value            <chr> "1st Half", "1st Half", "1st Half", "1…
## $ period_number                   <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ home_score                      <int> 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
## $ coordinate_x                    <int> 25, 25, 18, 25, 22, 25, 25, 25, 25, 25…
## $ coordinate_y                    <int> 0, 3, 21, 0, 1, 0, 0, 0, 0, 0, 9, 0, 0…
## $ scoring_play                    <lgl> FALSE, TRUE, FALSE, FALSE, TRUE, FALSE…
## $ clock_display_value             <chr> "20:00", "19:40", "19:19", "19:19", "1…
## $ team_id                         <chr> "96", "96", "150", "150", "150", "150"…
## $ type_id                         <chr> "615", "20572", "30558", "586", "20572…
## $ type_text                       <chr> "Jumpball", "LayUpShot", "Three Point …
## $ away_score                      <int> 0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,…
## $ id                              <dbl> 4.008092e+17, 4.008092e+17, 4.008092e+…
## $ text                            <chr> "Jump Ball won by Kentucky", "Jamal Mu…
## $ score_value                     <int> 0, 2, 3, 0, 2, 0, 1, 0, 1, 0, 2, 0, 0,…
## $ participants_0_athlete_id       <chr> NA, "3936299", "3135045", "56116", "56…
## $ participants_1_athlete_id       <chr> NA, "3136194", NA, NA, NA, NA, NA, NA,…
## $ media_id                        <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
## $ season                          <int> 2016, 2016, 2016, 2016, 2016, 2016, 20…
## $ season_type                     <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,…
## $ away_team_id                    <int> 96, 96, 96, 96, 96, 96, 96, 96, 96, 96…
## $ away_team_name                  <chr> "Kentucky", "Kentucky", "Kentucky", "K…
## $ away_team_mascot                <chr> "Wildcats", "Wildcats", "Wildcats", "W…
## $ away_team_abbrev                <chr> "UK", "UK", "UK", "UK", "UK", "UK", "U…
## $ away_team_name_alt              <chr> "Kentucky", "Kentucky", "Kentucky", "K…
## $ home_team_id                    <int> 150, 150, 150, 150, 150, 150, 150, 150…
## $ home_team_name                  <chr> "Duke", "Duke", "Duke", "Duke", "Duke"…
## $ home_team_mascot                <chr> "Blue Devils", "Blue Devils", "Blue De…
## $ home_team_abbrev                <chr> "DUKE", "DUKE", "DUKE", "DUKE", "DUKE"…
## $ home_team_name_alt              <chr> "Duke", "Duke", "Duke", "Duke", "Duke"…
## $ home_team_spread                <dbl> -1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1…
## $ game_spread                     <dbl> 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5…
## $ home_favorite                   <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FAL…
## $ game_spread_available           <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TR…
## $ game_id                         <int> 400809203, 400809203, 400809203, 40080…
## $ qtr                             <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ time                            <chr> "20:00", "19:40", "19:19", "19:19", "1…
## $ clock_minutes                   <chr> "20", "19", "19", "19", "19", "18", "1…
## $ clock_seconds                   <chr> "00", "40", "19", "19", "14", "48", "4…
## $ 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> 1200, 1180, 1159, 1159, 1154, 1128, 11…
## $ start_half_seconds_remaining    <int> 1800, 1780, 1759, 1759, 1754, 1728, 17…
## $ start_game_seconds_remaining    <int> 3000, 2980, 2959, 2959, 2954, 2928, 29…
## $ game_play_number                <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,…
## $ end_quarter_seconds_remaining   <dbl> 600, 1200, 1180, 1159, 1159, 1154, 112…
## $ end_half_seconds_remaining      <dbl> 1200, 1800, 1780, 1759, 1759, 1754, 17…
## $ end_game_seconds_remaining      <dbl> 2400, 3000, 2980, 2959, 2959, 2954, 29…
## $ period                          <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…

Men’s college basketball team box scores (2003-2021) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  mbb_team_box <- hoopR::load_mbb_team_box(2016:2021)
})
tictoc::toc()
## 3.326 sec elapsed
glue::glue("{nrow(mbb_team_box)} rows of men's college basketball team boxscore data from {length(unique(mbb_team_box$game_id))} games.")
## 66856 rows of men's college basketball team boxscore data from 33428 games.
dplyr::glimpse(mbb_team_box)
## Rows: 66,856
## Columns: 41
## $ team_short_display_name                                        <chr> "Kentuc…
## $ team_uid                                                       <chr> "s:40~l…
## $ team_alternate_color                                           <chr> "ffffff…
## $ team_color                                                     <chr> "005DAA…
## $ team_display_name                                              <chr> "Kentuc…
## $ team_name                                                      <chr> "Wildca…
## $ team_logo                                                      <chr> "https:…
## $ team_location                                                  <chr> "Kentuc…
## $ team_id                                                        <chr> "96", "…
## $ team_abbreviation                                              <chr> "UK", "…
## $ team_slug                                                      <chr> "kentuc…
## $ field_goals_made_field_goals_attempted                         <chr> "30-67"…
## $ field_goal_pct                                                 <chr> "44.8",…
## $ three_point_field_goals_made_three_point_field_goals_attempted <chr> "3-10",…
## $ three_point_field_goal_pct                                     <chr> "30.0",…
## $ free_throws_made_free_throws_attempted                         <chr> "11-18"…
## $ free_throw_pct                                                 <chr> "61.1",…
## $ total_rebounds                                                 <chr> "39", "…
## $ offensive_rebounds                                             <chr> "17", "…
## $ defensive_rebounds                                             <chr> "22", "…
## $ team_rebounds                                                  <chr> "0", "0…
## $ assists                                                        <chr> "15", "…
## $ steals                                                         <chr> "9", "3…
## $ blocks                                                         <chr> "7", "8…
## $ turnovers                                                      <chr> "9", "1…
## $ team_turnovers                                                 <chr> "1", "1…
## $ total_turnovers                                                <chr> "9", "1…
## $ technical_fouls                                                <chr> "0", "0…
## $ total_technical_fouls                                          <chr> "0", "0…
## $ flagrant_fouls                                                 <chr> "0", "0…
## $ fouls                                                          <chr> "21", "…
## $ largest_lead                                                   <chr> "16", "…
## $ home_away                                                      <chr> "HOME",…
## $ opponent_id                                                    <int> 150, 96…
## $ opponent_name                                                  <chr> "Duke",…
## $ opponent_mascot                                                <chr> "Blue D…
## $ opponent_abbrev                                                <chr> "DUKE",…
## $ game_id                                                        <int> 4008092…
## $ season                                                         <int> 2016, 2…
## $ season_type                                                    <int> 2, 2, 2…
## $ game_date                                                      <date> 2015-1…

Men’s college basketball player box scores (2003-2021) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  mbb_player_box <- hoopR::load_mbb_player_box(2016:2021)
})
tictoc::toc()
## 7.719 sec elapsed
glue::glue("{nrow(mbb_player_box)} rows of men's college basketball player boxscore data from {length(unique(mbb_player_box$game_id))} games.")
## 677446 rows of men's college basketball player boxscore data from 33441 games.
dplyr::glimpse(mbb_player_box)
## Rows: 677,446
## Columns: 34
## $ athlete_display_name          <chr> "Skal Labissiere", "Marcus Lee", "Jamal …
## $ team_short_display_name       <chr> "Kentucky", "Kentucky", "Kentucky", "Ken…
## $ min                           <chr> "13", "22", "38", "31", "40", "12", "7",…
## $ fg                            <chr> "3-5", "5-10", "7-17", "5-8", "6-13", "1…
## $ fg3                           <chr> "0-0", "0-0", "2-3", "1-1", "0-4", "0-0"…
## $ ft                            <chr> "1-2", "0-0", "0-2", "1-3", "6-6", "0-0"…
## $ oreb                          <chr> "2", "5", "3", "0", "0", "2", "0", "4", …
## $ dreb                          <chr> "2", "5", "2", "3", "4", "1", "0", "3", …
## $ reb                           <chr> "4", "10", "5", "3", "4", "3", "0", "7",…
## $ ast                           <chr> "1", "1", "5", "1", "6", "1", "0", "0", …
## $ stl                           <chr> "0", "0", "4", "2", "2", "0", "0", "0", …
## $ blk                           <chr> "1", "2", "0", "0", "1", "2", "0", "1", …
## $ to                            <chr> "2", "1", "3", "1", "0", "1", "0", "0", …
## $ pf                            <chr> "5", "5", "2", "1", "0", "3", "1", "4", …
## $ pts                           <chr> "7", "10", "16", "12", "18", "2", "0", "…
## $ starter                       <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FAL…
## $ ejected                       <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ did_not_play                  <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ active                        <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE…
## $ athlete_jersey                <chr> "1", "24", "23", "13", "3", "15", "35", …
## $ athlete_id                    <chr> "3936296", "66612", "3936299", "3936294"…
## $ athlete_short_name            <chr> "S. Labissiere", "M. Lee", "J. Murray", …
## $ athlete_headshot_href         <chr> NA, NA, NA, NA, NA, NA, NA, NA, "https:/…
## $ athlete_position_name         <chr> "Forward", "Forward", "Guard", "Guard", …
## $ athlete_position_abbreviation <chr> "F", "F", "G", "G", "G", "F", "F", "F", …
## $ team_name                     <chr> "Wildcats", "Wildcats", "Wildcats", "Wil…
## $ team_logo                     <chr> "https://a.espncdn.com/i/teamlogos/ncaa/…
## $ team_id                       <chr> "96", "96", "96", "96", "96", "96", "96"…
## $ team_abbreviation             <chr> "UK", "UK", "UK", "UK", "UK", "UK", "UK"…
## $ team_color                    <chr> "005DAA", "005DAA", "005DAA", "005DAA", …
## $ game_id                       <int> 400809203, 400809203, 400809203, 4008092…
## $ season                        <int> 2016, 2016, 2016, 2016, 2016, 2016, 2016…
## $ season_type                   <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2…
## $ game_date                     <date> 2015-11-18, 2015-11-18, 2015-11-18, 201…

Our Authors

Our Contributors (they’re awesome)