knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
# pacman::p_load_current_gh("r-lib/pkgapi")
# pacman::p_load_current_gh("hadley/emo")
# library(pkgapi)
# pkg <- pkgapi::map_package(path = "../")
# exported <- pkg$defs %>% dplyr::filter(exported == TRUE)

pkg_name <- "sportsdataverse/wehoop"
url <- paste0("https://raw.githubusercontent.com/", pkg_name, "/main/DESCRIPTION")


x <- readLines(url)
remote_version <- gsub("Version:\\s*", "", x[grep('Version:', x)])

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)

  3. Windows - Select base and download the most recent version

  4. 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
  5. Linux - Select the appropriate distro and follow the installation instructions

  6. Head to Posit.co

  7. Follow the associated download and installation instructions for RStudio.
  8. Start peering over the RStudio IDE Cheatsheet. An IDE is an integrated development environment.
  9. 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-r wehoop::most_recent_wnba_season()) ~ 30-60 seconds

tictoc::tic()
progressr::with_progress({
  wnba_pbp <- wehoop::load_wnba_pbp()
})
tictoc::toc()
## 13.91 sec elapsed
glue::glue("{nrow(wnba_pbp)} rows of WNBA play-by-play data from {length(unique(wnba_pbp$game_id))} games.")
## 1782985 rows of WNBA play-by-play data from 4674 games.
dplyr::glimpse(wnba_pbp)

WNBA full team box score seasons (2003-r wehoop::most_recent_wnba_season()) ~ 5-30 seconds

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

tictoc::toc()

glue::glue("{nrow(wnba_team_box)} rows of WNBA team boxscore data from {length(unique(wnba_team_box$game_id))} games.")
dplyr::glimpse(wnba_team_box)

WNBA full player box score seasons (2002-r wehoop::most_recent_wnba_season()) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  wnba_player_box <- wehoop::load_wnba_player_box()
})
tictoc::toc()
length(unique(wnba_player_box$game_id))
nrow(wnba_player_box)

Women's college basketball full play-by-play seasons (2004-r wehoop::most_recent_wbb_season()) ~ 45-90 seconds

tictoc::tic()
progressr::with_progress({
  wbb_pbp <- wehoop::load_wbb_pbp()
})
tictoc::toc()
length(unique(wbb_pbp$game_id))
nrow(wbb_pbp)

Women's college basketball full team box score seasons (2006-r wehoop::most_recent_wbb_season()) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  wbb_team_box <- wehoop::load_wbb_team_box()
})
tictoc::toc()
length(unique(wbb_team_box$game_id))
nrow(wbb_team_box)

Women's college basketball full player box score seasons (2006-r wehoop::most_recent_wbb_season()) ~ 5-30 seconds

tictoc::tic()
progressr::with_progress({
  wbb_player_box <- wehoop::load_wbb_player_box()
})
tictoc::toc()
length(unique(wbb_player_box$game_id))
nrow(wbb_player_box)

Our Authors



saiemgilani/wehoop documentation built on July 25, 2024, 2:46 a.m.