From 5ae4e057348009ff008734353c94ec53c25fb424 Mon Sep 17 00:00:00 2001 From: Saiem Gilani Date: Mon, 24 May 2021 14:59:23 -0400 Subject: [PATCH] loaders wbb/wnba players/teams --- .gitignore | 3 +- DESCRIPTION | 3 +- NAMESPACE | 7 + NEWS.md | 16 + R/espn_wbb_data.R | 401 ++++++++++++---------- R/espn_wnba_data.R | 80 +++++ R/wbb_pbp.R | 172 +++++++++- R/wnba_pbp.R | 172 +++++++++- README.Rmd | 24 +- _pkgdown.yml | 9 + docs/404.html | 12 +- docs/CODE_OF_CONDUCT.html | 12 +- docs/LICENSE-text.html | 12 +- docs/LICENSE.html | 12 +- docs/authors.html | 12 +- docs/index.html | 123 +++++-- docs/pkgdown.yml | 5 +- docs/reference/espn_wbb_game_all.html | 225 ++++++------ docs/reference/espn_wbb_pbp.html | 55 +-- docs/reference/espn_wbb_player_box.html | 188 +++++----- docs/reference/espn_wbb_rankings.html | 56 +-- docs/reference/espn_wbb_scoreboard.html | 21 +- docs/reference/espn_wbb_team_box.html | 27 +- docs/reference/espn_wbb_teams.html | 52 ++- docs/reference/espn_wnba_game_all.html | 236 ++++++------- docs/reference/espn_wnba_pbp.html | 50 +-- docs/reference/espn_wnba_player_box.html | 198 +++++------ docs/reference/espn_wnba_scoreboard.html | 16 +- docs/reference/espn_wnba_team_box.html | 21 +- docs/reference/espn_wnba_teams.html | 50 +-- docs/reference/index.html | 205 +++++++++-- docs/reference/ncaa_wbb_NET_rankings.html | 36 +- docs/reference/pipe.html | 12 +- docs/sitemap.xml | 39 +++ man/espn_wbb_game_all.Rd | 4 +- man/espn_wbb_pbp.Rd | 4 +- man/espn_wbb_player_box.Rd | 4 +- man/espn_wbb_scoreboard.Rd | 4 +- man/espn_wbb_standings.Rd | 19 + man/espn_wbb_team_box.Rd | 4 +- man/espn_wnba_standings.Rd | 24 ++ man/load_wbb_pbp.Rd | 6 + man/load_wbb_player_box.Rd | 26 ++ man/load_wbb_team_box.Rd | 26 ++ man/load_wnba_pbp.Rd | 6 + man/load_wnba_player_box.Rd | 26 ++ man/load_wnba_team_box.Rd | 26 ++ man/update_wbb_db.Rd | 2 +- man/update_wnba_db.Rd | 2 +- tests/testthat/test-espn_wbb_standings.R | 38 ++ tests/testthat/test-espn_wnba_standings.R | 15 + vignettes/getting-started-wehoop.Rmd | 144 ++++++++ 52 files changed, 2049 insertions(+), 893 deletions(-) create mode 100644 man/espn_wbb_standings.Rd create mode 100644 man/espn_wnba_standings.Rd create mode 100644 man/load_wbb_player_box.Rd create mode 100644 man/load_wbb_team_box.Rd create mode 100644 man/load_wnba_player_box.Rd create mode 100644 man/load_wnba_team_box.Rd create mode 100644 tests/testthat/test-espn_wbb_standings.R create mode 100644 tests/testthat/test-espn_wnba_standings.R create mode 100644 vignettes/getting-started-wehoop.Rmd diff --git a/.gitignore b/.gitignore index 06e29ecf..a9eb1abb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ data-raw* inst/doc* kenpomR.Rcheck* wnba_pbp_db* -wbb_pbp_db* \ No newline at end of file +wbb_pbp_db* +docs* \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 9f1f3053..35daea8d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: wehoop Title: Functions to Access Women's Basketball Play by Play Data -Version: 0.9.2 +Version: 1.0.0 Authors@R: c(person('Saiem', 'Gilani', email = 'saiem.gilani@gmail.com',role = c('aut','cre')), person('Geoff','Hutchinson', email = 'geoffery.hutchinson@gmail.com', role = c('aut'))) Description: The R package wehoop is for working with women's college and professional basketball data. A scraping and aggregating interface for ESPN's women's college basketball and WNBA statistics, [espn.com](https://espn.com). It provides users with the capability to access the API's game play-by-plays, box scores, standings and results to analyze the data for themselves. @@ -11,6 +11,7 @@ BugReports: https://www.github.com/saiemgilani/wehoop/issues Encoding: UTF-8 Depends: R (>= 3.5.0) Imports: + data.table, dplyr, furrr, future, diff --git a/NAMESPACE b/NAMESPACE index 8eb1404e..ecb92971 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,22 +7,29 @@ export(espn_wbb_pbp) export(espn_wbb_player_box) export(espn_wbb_rankings) export(espn_wbb_scoreboard) +export(espn_wbb_standings) export(espn_wbb_team_box) export(espn_wbb_teams) export(espn_wnba_game_all) export(espn_wnba_pbp) export(espn_wnba_player_box) export(espn_wnba_scoreboard) +export(espn_wnba_standings) export(espn_wnba_team_box) export(espn_wnba_teams) export(load_wbb_pbp) +export(load_wbb_player_box) +export(load_wbb_team_box) export(load_wnba_pbp) +export(load_wnba_player_box) +export(load_wnba_team_box) export(ncaa_wbb_NET_rankings) export(update_wbb_db) export(update_wnba_db) import(furrr) import(rvest) import(utils) +importFrom(data.table,rbindlist) importFrom(dplyr,"%>%") importFrom(dplyr,any_of) importFrom(dplyr,arrange) diff --git a/NEWS.md b/NEWS.md index 62fcc2d3..4bcae708 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,19 @@ +# **wehoop 1.0.0** +### **Add team box score loaders** +- [```wehoop::load_wbb_team_box()```](https://saiemgilani.github.io/wehoop/reference/load_wbb_team_box.html) function added +- [```wehoop::load_wnba_team_box()```](https://saiemgilani.github.io/wehoop/reference/load_wnba_team_box.html) function added + +### **Add player box score loaders** +- [```wehoop::load_wbb_player_box()```](https://saiemgilani.github.io/wehoop/reference/load_wbb_player_box.html) function added +- [```wehoop::load_wnba_player_box()```](https://saiemgilani.github.io/wehoop/reference/load_wnba_player_box.html) function added + +### **Standings functions** +- [```wehoop::espn_wnba_standings()```](https://saiemgilani.github.io/wehoop/reference/espn_wnba_standings.html) +- [```wehoop::espn_wbb_standings()```](https://saiemgilani.github.io/wehoop/reference/espn_wbb_standings.html) + +### **Getting Started vignette** +- [Getting started with wehoop data](https://saiemgilani.github.io/wehoop/articles/getting-started-wehoop.html) + # **wehoop 0.9.2** ### **Quick fix for update db functions** diff --git a/R/espn_wbb_data.R b/R/espn_wbb_data.R index 6c4ef5f3..65141f67 100644 --- a/R/espn_wbb_data.R +++ b/R/espn_wbb_data.R @@ -1,7 +1,6 @@ #' Get ESPN women's college basketball game data (play-by-play, team and player box) #' @author Saiem Gilani #' @param game_id Game ID -#' @param verbose Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function #' @keywords WBB Game #' @importFrom rlang .data #' @importFrom jsonlite fromJSON toJSON @@ -12,34 +11,36 @@ #' @examples #' espn_wbb_game_all(game_id = 401276115) -espn_wbb_game_all <- function(game_id, verbose = FALSE){ +espn_wbb_game_all <- function(game_id){ options(stringsAsFactors = FALSE) options(scipen = 999) - + play_base_url <- "http://cdn.espn.com/womens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" - + ## Inputs ## game_id full_url <- paste0(play_base_url, "gameId=", game_id) - res <- httr::RETRY( - "GET", full_url - ) + + res <- httr::RETRY("GET", full_url) # Check the result check_status(res) + resp <- res %>% httr::content(as = "text", encoding = "UTF-8") - raw_play_df <- jsonlite::fromJSON(resp)[["gamepackageJSON"]] + plays_df <- data.frame() team_box <- data.frame() player_box <- data.frame() + #---- Play-by-Play ------ tryCatch( expr = { + raw_play_df <- jsonlite::fromJSON(resp)[["gamepackageJSON"]] plays <- raw_play_df[["plays"]] plays <- jsonlite::fromJSON(jsonlite::toJSON(plays), flatten=TRUE) raw_play_df <- jsonlite::fromJSON(jsonlite::toJSON(raw_play_df),flatten=TRUE) - #---- Play-by-Play ------ + plays <- plays %>% tidyr::unnest_wider(unlist(.data$participants)) suppressWarnings( @@ -54,9 +55,7 @@ espn_wbb_game_all <- function(game_id, verbose = FALSE){ }, error = function(e) { - if(verbose){ - message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!")) - } + message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!")) }, warning = function(w) { }, @@ -74,16 +73,14 @@ espn_wbb_game_all <- function(game_id, verbose = FALSE){ teams_box_score_df_1 <- teams_box_score_df[[1]][[1]] %>% dplyr::select(.data$displayValue) %>% dplyr::rename(Away = .data$displayValue) - + team_box_score = dplyr::bind_cols(teams_box_score_df_2, teams_box_score_df_1) tm <- c(teams_box_score_df[2,"team.shortDisplayName"], "Team", teams_box_score_df[1,"team.shortDisplayName"]) names(tm) <- c("Home","label","Away") team_box_score = dplyr::bind_rows(tm, team_box_score) }, error = function(e) { - if(verbose){ - message(glue::glue("{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!")) - } + message(glue::glue("{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!")) }, warning = function(w) { }, @@ -99,10 +96,10 @@ espn_wbb_game_all <- function(game_id, verbose = FALSE){ tidyr::unnest(.data$athletes) stat_cols <- players_df$names[[1]] stats <- players_df$stats - + stats_df <- as.data.frame(do.call(rbind,stats)) colnames(stats_df) <- stat_cols - + players_df <- players_df %>% dplyr::filter(!.data$didNotPlay) %>% dplyr::select(.data$starter,.data$ejected, .data$didNotPlay,.data$active, @@ -113,7 +110,7 @@ espn_wbb_game_all <- function(game_id, verbose = FALSE){ .data$team.name,.data$team.logo,.data$team.id,.data$team.abbreviation, .data$team.color,.data$team.alternateColor ) - + player_box <- dplyr::bind_cols(stats_df,players_df) %>% dplyr::select(.data$athlete.displayName,.data$team.shortDisplayName, tidyr::everything()) plays_df <- plays_df %>% @@ -127,16 +124,14 @@ espn_wbb_game_all <- function(game_id, verbose = FALSE){ ) }, error = function(e) { - if(verbose){ - message(glue::glue("{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!")) - } + message(glue::glue("{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!")) }, warning = function(w) { }, finally = { } ) - + pbp <- c(list(plays_df), list(team_box_score),list(player_box)) names(pbp) <- c("Plays","Team","Player") return(pbp) @@ -145,7 +140,6 @@ espn_wbb_game_all <- function(game_id, verbose = FALSE){ #' Get ESPN women's college basketball play by play data #' @author Saiem Gilani #' @param game_id Game ID -#' @param verbose Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function #' @keywords WBB PBP #' @importFrom rlang .data #' @importFrom jsonlite fromJSON toJSON @@ -155,29 +149,31 @@ espn_wbb_game_all <- function(game_id, verbose = FALSE){ #' @export #' @examples #' espn_wbb_pbp(game_id = 401276115) -espn_wbb_pbp <- function(game_id, verbose = FALSE){ +espn_wbb_pbp <- function(game_id){ options(stringsAsFactors = FALSE) options(scipen = 999) - + play_base_url <- "http://cdn.espn.com/womens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" + plays_df <- data.frame() + ## Inputs ## game_id full_url <- paste0(play_base_url, "gameId=", game_id) - res <- httr::RETRY( - "GET", full_url - ) + + res <- httr::RETRY("GET", full_url) # Check the result check_status(res) + resp <- res %>% httr::content(as = "text", encoding = "UTF-8") tryCatch( expr = { raw_play_df <- jsonlite::fromJSON(resp)[["gamepackageJSON"]][["plays"]] - + raw_play_df <- jsonlite::fromJSON(jsonlite::toJSON(raw_play_df),flatten=TRUE) #---- Play-by-Play ------ plays <- raw_play_df %>% @@ -195,22 +191,19 @@ espn_wbb_pbp <- function(game_id, verbose = FALSE){ janitor::clean_names() }, error = function(e) { - if(verbose){ - message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!")) - } + message(glue::glue("{Sys.time()}: Invalid arguments or no play-by-play data for {game_id} available!")) }, warning = function(w) { }, finally = { } ) - + return(plays_df) } #' Get ESPN women's college basketball team box data #' @author Saiem Gilani #' @param game_id Game ID -#' @param verbose Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function #' @keywords WBB Team Box #' @importFrom rlang .data #' @importFrom jsonlite fromJSON toJSON @@ -220,25 +213,22 @@ espn_wbb_pbp <- function(game_id, verbose = FALSE){ #' @export #' @examples #' espn_wbb_team_box(game_id = 401276115) -espn_wbb_team_box <- function(game_id, verbose = FALSE){ +espn_wbb_team_box <- function(game_id){ options(stringsAsFactors = FALSE) options(scipen = 999) play_base_url <- "http://cdn.espn.com/womens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" - - ## Inputs - ## game_id + full_url <- paste0(play_base_url, "gameId=", game_id) - res <- httr::RETRY( - "GET", full_url - ) + + res <- httr::RETRY("GET", full_url) # Check the result check_status(res) + resp <- res %>% httr::content(as = "text", encoding = "UTF-8") - #---- Team Box ------ tryCatch( expr = { @@ -251,7 +241,7 @@ espn_wbb_team_box <- function(game_id, verbose = FALSE){ teams_box_score_df_1 <- teams_box_score_df[[1]][[1]] %>% dplyr::select(.data$displayValue) %>% dplyr::rename(Away = .data$displayValue) - + team_box_score = dplyr::bind_cols(teams_box_score_df_2, teams_box_score_df_1) tm <- c(teams_box_score_df[2,"team.shortDisplayName"], "Team", teams_box_score_df[1,"team.shortDisplayName"]) names(tm) <- c("Home","label","Away") @@ -260,20 +250,18 @@ espn_wbb_team_box <- function(game_id, verbose = FALSE){ janitor::clean_names() }, error = function(e) { - if(verbose) message(glue::glue("{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!")) + message(glue::glue("{Sys.time()}: Invalid arguments or no team box score data for {game_id} available!")) }, warning = function(w) { }, finally = { } ) - return(team_box_score) } #' Get ESPN women's college basketball player box #' @author Saiem Gilani #' @param game_id Game ID -#' @param verbose Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function #' @keywords WBB Player Box #' @importFrom rlang .data #' @importFrom jsonlite fromJSON toJSON @@ -283,24 +271,23 @@ espn_wbb_team_box <- function(game_id, verbose = FALSE){ #' @export #' @examples #' espn_wbb_player_box(game_id = 401276115) -espn_wbb_player_box <- function(game_id, verbose = FALSE){ +espn_wbb_player_box <- function(game_id){ options(stringsAsFactors = FALSE) options(scipen = 999) play_base_url <- "http://cdn.espn.com/womens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" - + ## Inputs ## game_id full_url <- paste0(play_base_url, "gameId=", game_id) - res <- httr::RETRY( - "GET", full_url - ) + + res <- httr::RETRY("GET", full_url) # Check the result check_status(res) - resp <- res %>% - httr::content(as = "text", encoding = "UTF-8") + resp <- res %>% + httr::content(as = "text", encoding = "UTF-8") #---- Player Box ------ tryCatch( @@ -312,10 +299,10 @@ espn_wbb_player_box <- function(game_id, verbose = FALSE){ tidyr::unnest(.data$athletes) stat_cols <- players_df$names[[1]] stats <- players_df$stats - + stats_df <- as.data.frame(do.call(rbind,stats)) colnames(stats_df) <- stat_cols - + players_df <- players_df %>% dplyr::filter(!.data$didNotPlay) %>% dplyr::select(.data$starter,.data$ejected, .data$didNotPlay,.data$active, @@ -326,7 +313,7 @@ espn_wbb_player_box <- function(game_id, verbose = FALSE){ .data$team.name,.data$team.logo,.data$team.id,.data$team.abbreviation, .data$team.color,.data$team.alternateColor ) - + player_box <- dplyr::bind_cols(stats_df,players_df) %>% dplyr::select(.data$athlete.displayName,.data$team.shortDisplayName, tidyr::everything()) player_box <- player_box %>% @@ -336,7 +323,7 @@ espn_wbb_player_box <- function(game_id, verbose = FALSE){ ) }, error = function(e) { - if(verbose) message(glue::glue("{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!")) + message(glue::glue("{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!")) }, warning = function(w) { }, @@ -347,7 +334,45 @@ espn_wbb_player_box <- function(game_id, verbose = FALSE){ } - +#' Get women's college basketball conferences +#' +#' @author Saiem Gilani +#' @return Returns a tibble +#' @importFrom jsonlite fromJSON +#' @importFrom janitor clean_names +#' @importFrom dplyr select +#' @import rvest +#' @export +#' @examples +#' espn_wbb_conferences() +espn_wbb_conferences <- function(){ + options(stringsAsFactors = FALSE) + options(scipen = 999) + play_base_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/scoreboard/conferences" + + res <- httr::RETRY("GET", play_base_url) + + # Check the result + check_status(res) + + resp <- res %>% + httr::content(as = "text", encoding = "UTF-8") + tryCatch( + expr = { + conferences <- jsonlite::fromJSON(resp)[["conferences"]] %>% + dplyr::select(-.data$subGroups) %>% + janitor::clean_names() + }, + error = function(e) { + message(glue::glue("{Sys.time()}: Invalid arguments or no conferences info available!")) + }, + warning = function(w) { + }, + finally = { + } + ) + return(conferences) +} #' Get ESPN women's college basketball team names and ids #' @author Saiem Gilani @@ -367,15 +392,15 @@ espn_wbb_teams <- function(){ options(stringsAsFactors = FALSE) options(scipen = 999) play_base_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/teams?groups=50&limit=1000" - - res <- httr::RETRY( - "GET", play_base_url - ) + + res <- httr::RETRY("GET", play_base_url) # Check the result check_status(res) + resp <- res %>% httr::content(as = "text", encoding = "UTF-8") + tryCatch( expr = { @@ -386,7 +411,7 @@ espn_wbb_teams <- function(){ dplyr::select(-.data$logos_width,-.data$logos_height, -.data$logos_alt, -.data$logos_rel) %>% dplyr::ungroup() - + records <- leagues$record records<- records %>% tidyr::unnest_wider(.data$items) %>% tidyr::unnest_wider(.data$stats,names_sep = "_") %>% @@ -395,16 +420,16 @@ espn_wbb_teams <- function(){ dplyr::group_by(.data$row) %>% purrr::map_if(is.data.frame, list) stat <- lapply(stat$stats_1,function(x) x %>% - purrr::map_if(is.data.frame,list) %>% - dplyr::as_tibble() ) - + purrr::map_if(is.data.frame,list) %>% + dplyr::as_tibble() ) + s <- lapply(stat, function(x) { tidyr::pivot_wider(x) }) - + s <- tibble::tibble(g = s) stats <- s %>% unnest_wider(.data$g) - + records <- dplyr::bind_cols(records %>% dplyr::select(.data$summary), stats) leagues <- leagues %>% dplyr::select( -.data$record, @@ -440,7 +465,6 @@ espn_wbb_teams <- function(){ #' Get women's college basketball schedule for a specific year from ESPN's API #' #' @param season Either numeric or character -#' @param verbose Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function #' @author Thomas Mock, you a genius for this one. #' @return Returns a tibble #' @import utils @@ -456,25 +480,24 @@ espn_wbb_teams <- function(){ #' # Get schedule from date 2021-02-15, then next date and so on. #' espn_wbb_scoreboard (season = "20210215") -espn_wbb_scoreboard <- function(season, verbose = FALSE){ - +espn_wbb_scoreboard <- function(season){ + # message(glue::glue("Returning data for {season}!")) - + max_year <- substr(Sys.Date(), 1,4) - + if(!(as.integer(substr(season, 1, 4)) %in% c(2001:max_year))){ message(paste("Error: Season must be between 2001 and", max_year)) } - + # year > 2000 season <- as.character(season) - + season_dates <- season - + schedule_api <- glue::glue("http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/scoreboard?groups=50&limit=1000&dates={season_dates}") - res <- httr::RETRY( - "GET", schedule_api - ) + + res <- httr::RETRY("GET", schedule_api) # Check the result check_status(res) @@ -485,7 +508,7 @@ espn_wbb_scoreboard <- function(season, verbose = FALSE){ httr::content(as = "text", encoding = "UTF-8") %>% jsonlite::fromJSON(simplifyDataFrame = FALSE, simplifyVector = FALSE, simplifyMatrix = FALSE) - + wbb_data <- raw_sched[["events"]] %>% tibble::tibble(data = .data$.) %>% tidyr::unnest_wider(.data$data) %>% @@ -527,7 +550,7 @@ espn_wbb_scoreboard <- function(season, verbose = FALSE){ away_win = as.integer(.data$away_win), home_score = as.integer(.data$home_score), away_score = as.integer(.data$away_score)) - + if("leaders" %in% names(wbb_data)){ schedule_out <- wbb_data %>% tidyr::hoist( @@ -557,7 +580,7 @@ espn_wbb_scoreboard <- function(season, verbose = FALSE){ assists_leader_team_id = list(3, "leaders", 1, "team", "id"), assists_leader_pos = list(3, "leaders", 1, "athlete", "position", "abbreviation"), ) - + if("broadcasts" %in% names(schedule_out)) { schedule_out %>% tidyr::hoist( @@ -577,7 +600,7 @@ espn_wbb_scoreboard <- function(season, verbose = FALSE){ } }, error = function(e) { - if(verbose) message(glue::glue("{Sys.time()}: Invalid arguments or no player box score data for {game_id} available!")) + message(glue::glue("{Sys.time()}: Invalid arguments or no scoreboard data available!")) }, warning = function(w) { }, @@ -601,8 +624,8 @@ utils::globalVariables(c("where")) #' ncaa_wbb_NET_rankings() ncaa_wbb_NET_rankings <- function(){ - - + + NET_url <- "https://www.ncaa.com/rankings/basketball-women/d1/ncaa-womens-basketball-net-rankings" tryCatch( expr = { @@ -641,118 +664,130 @@ ncaa_wbb_NET_rankings <- function(){ espn_wbb_rankings <- function(){ options(stringsAsFactors = FALSE) options(scipen = 999) - + ranks_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/rankings?groups=50" - - ## Inputs - ## game_id - - res <- httr::RETRY( - "GET", ranks_url - ) + + res <- httr::RETRY("GET", ranks_url) # Check the result check_status(res) + resp <- res %>% httr::content(as = "text", encoding = "UTF-8") - ranks_df <- jsonlite::fromJSON(resp,flatten = TRUE)[['rankings']] - ranks_top25 <- ranks_df %>% - dplyr::select(-.data$date,-.data$lastUpdated) %>% - tidyr::unnest(.data$ranks, names_repair="minimal") - ranks_others <- ranks_df %>% - dplyr::select(-.data$date,-.data$lastUpdated) %>% - tidyr::unnest(.data$others, names_repair="minimal") - ranks_dropped_out <- ranks_df %>% - dplyr::select(-.data$date,-.data$lastUpdated) %>% - tidyr::unnest(.data$droppedOut, names_repair="minimal") - - ranks <- dplyr::bind_rows(ranks_top25, ranks_others, ranks_dropped_out) - drop_cols <- c( - "$ref", "team.links","season.powerIndexes.$ref", - "season.powerIndexLeaders.$ref", "season.athletes.$ref", - "season.leaders.$ref","season.powerIndexLeaders.$ref", - "others","droppedOut","ranks" + tryCatch( + expr = { + + ranks_df <- jsonlite::fromJSON(resp,flatten = TRUE)[['rankings']] + ranks_top25 <- ranks_df %>% + dplyr::select(-.data$date,-.data$lastUpdated) %>% + tidyr::unnest(.data$ranks, names_repair="minimal") + ranks_others <- ranks_df %>% + dplyr::select(-.data$date,-.data$lastUpdated) %>% + tidyr::unnest(.data$others, names_repair="minimal") + ranks_dropped_out <- ranks_df %>% + dplyr::select(-.data$date,-.data$lastUpdated) %>% + tidyr::unnest(.data$droppedOut, names_repair="minimal") + + ranks <- dplyr::bind_rows(ranks_top25, ranks_others, ranks_dropped_out) + drop_cols <- c( + "$ref", "team.links","season.powerIndexes.$ref", + "season.powerIndexLeaders.$ref", "season.athletes.$ref", + "season.leaders.$ref","season.powerIndexLeaders.$ref", + "others","droppedOut","ranks" + ) + ranks <- ranks %>% + dplyr::select(-dplyr::any_of(drop_cols)) + ranks <- ranks %>% dplyr::arrange(.data$name,-.data$points) %>% + janitor::clean_names() + }, + error = function(e) { + message(glue::glue("{Sys.time()}: Invalid arguments or no rankings data for {game_id} available!")) + }, + warning = function(w) { + }, + finally = { + } ) - ranks <- ranks %>% - dplyr::select(-dplyr::any_of(drop_cols)) - ranks <- ranks %>% dplyr::arrange(.data$name,-.data$points) %>% - janitor::clean_names() + return(ranks) } -#' Get women's college basketball conferences + + +#' Get ESPN women's college basketball standings #' -#' @author Saiem Gilani -#' @return Returns a tibble -#' @importFrom jsonlite fromJSON -#' @importFrom janitor clean_names -#' @importFrom dplyr select -#' @import rvest +#' @param year Either numeric or character (YYYY) +#' @keywords WBB Standings +#' @importFrom rlang .data +#' @importFrom jsonlite fromJSON toJSON +#' @importFrom dplyr select rename +#' @importFrom tidyr pivot_wider #' @export #' @examples -#' espn_wbb_conferences() -espn_wbb_conferences <- function(){ - options(stringsAsFactors = FALSE) - options(scipen = 999) - play_base_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/womens-college-basketball/scoreboard/conferences" +#' espn_wbb_standings(2021) +espn_wbb_standings <- function(year){ + + standings_url <- "https://site.web.api.espn.com/apis/v2/sports/basketball/womens-college-basketball/standings?region=us&lang=en&contentorigin=espn&type=0&level=1&sort=winpercent%3Adesc%2Cwins%3Adesc%2Cgamesbehind%3Aasc&" ## Inputs - ## game_id - res <- httr::RETRY( - "GET", play_base_url - ) + ## year + full_url <- paste0(standings_url, + "season=", year) + + res <- httr::RETRY("GET", full_url) # Check the result check_status(res) - resp <- res %>% - httr::content(as = "text", encoding = "UTF-8") - conferences <- jsonlite::fromJSON(resp)[["conferences"]] %>% - dplyr::select(-.data$subGroups) %>% - janitor::clean_names() - - return(conferences) -} - -#' -#' #' Get Women's College Basketball Standings -#' #' -#' #' @author Saiem Gilani -#' #' @return Returns a tibble -#' #' @importFrom dplyr %>% bind_rows arrange select -#' #' @importFrom jsonlite fromJSON -#' #' @importFrom tidyr unnest -#' #' @importFrom glue glue -#' #' @import rvest -#' #' @export -#' #' @examples -#' #' # Get current AP and Coaches Poll rankings -#' #' wbb_standings() -#' -#' wbb_standings <- function(conference=NULL){ -#' options(stringsAsFactors = FALSE) -#' options(scipen = 999) -#' if(is.null(conference)){ -#' conference = 50 -#' } -#' standings_url <- glue::glue("http://site.api.espn.com/apis/v2/sports/basketball/womens-college-basketball/standings?group={conference}") -#' -#' ## Inputs -#' ## game_id -#' -#' standings_df <- jsonlite::fromJSON(standings_url,flatten = TRUE)[['children']] -#' standings_df <- standings_df %>% -#' tidyr::unnest(.data$standings.entries, names_repair='minimal') -#' -#' stats_df <- standings_df %>% -#' dplyr::group_by(.data$team.displayName) %>% -#' tidyr::unnest_wider(.data$stats, names_repair='check_unique', names_sep = '.') %>% -#' dplyr::select(.data$team.displayName, .data$stats.displayName, .data$stats.displayValue) -#' -#' stats_df %>% tidyr::unnest_wider(unlist(.data$stats.displayName), -#' values_from=unlist(.data$stats.displayValue), names_sep = ".") -#' -#' -#' -#' return(ranks) -#' } -#' \ No newline at end of file + tryCatch( + expr = { + resp <- res %>% + httr::content(as = "text", encoding = "UTF-8") + + raw_standings <- jsonlite::fromJSON(resp)[["standings"]] + + #Create a dataframe of all WBB teams by extracting from the raw_standings file + + teams <- raw_standings[["entries"]][["team"]] + + teams <- teams %>% + dplyr::select(.data$id, .data$displayName) %>% + dplyr::rename(team_id = .data$id, + team = .data$displayName) + + #creating a dataframe of the WNBA raw standings table from ESPN + + standings_df <- raw_standings[["entries"]][["stats"]] + + standings_data <- data.table::rbindlist(standings_df, fill = TRUE, idcol = T) + + #Use the following code to replace NA's in the dataframe with the correct corresponding values and removing all unnecessary columns + + standings_data$value <- ifelse(is.na(standings_data$value) & !is.na(standings_data$summary), standings_data$summary, standings_data$value) + + standings_data <- standings_data %>% + dplyr::select(.data$.id, .data$type, .data$value) + + #Use pivot_wider to transpose the dataframe so that we now have a standings row for each team + + standings_data <- standings_data %>% + tidyr::pivot_wider(names_from = .data$type, values_from = .data$value) + + + standings_data <- standings_data %>% + dplyr::select(-.data$.id) + + #joining the 2 dataframes together to create a standings table + + standings <- cbind(teams, standings_data) + }, + error = function(e) { + message(glue::glue("{Sys.time()}: Invalid arguments or no standings data available!")) + }, + warning = function(w) { + }, + finally = { + } + + ) + return(standings) +} \ No newline at end of file diff --git a/R/espn_wnba_data.R b/R/espn_wnba_data.R index 8aebb336..2fae145a 100644 --- a/R/espn_wnba_data.R +++ b/R/espn_wnba_data.R @@ -454,6 +454,86 @@ espn_wnba_scoreboard <- function(season){ } } +#' Get ESPN WNBA Standings +#' +#' @author Geoff Hutchinson +#' @param year Either numeric or character (YYYY) +#' @keywords WNBA Standings +#' @importFrom rlang .data +#' @importFrom jsonlite fromJSON toJSON +#' @importFrom dplyr select rename +#' @importFrom tidyr pivot_wider +#' @importFrom data.table rbindlist +#' @export +#' @examples +#' \dontrun{ +#' espn_wnba_standings(year = 2021) +#' } +espn_wnba_standings <- function(year){ + + standings_url <- "https://site.web.api.espn.com/apis/v2/sports/basketball/wnba/standings?region=us&lang=en&contentorigin=espn&type=0&level=1&sort=winpercent%3Adesc%2Cwins%3Adesc%2Cgamesbehind%3Aasc&" + + ## Inputs + ## year + full_url <- paste0(standings_url, + "season=", year) + + res <- httr::RETRY("GET", full_url) + + # Check the result + check_status(res) + tryCatch( + expr = { + resp <- res %>% + httr::content(as = "text", encoding = "UTF-8") + + raw_standings <- jsonlite::fromJSON(resp)[["standings"]] + + #Create a dataframe of all NBA teams by extracting from the raw_standings file + + teams <- raw_standings[["entries"]][["team"]] + + teams <- teams %>% + dplyr::select(.data$id, .data$displayName) %>% + dplyr::rename(team_id = .data$id, + team = .data$displayName) + + #creating a dataframe of the WNBA raw standings table from ESPN + + standings_df <- raw_standings[["entries"]][["stats"]] + + standings_data <- data.table::rbindlist(standings_df, fill = TRUE, idcol = T) + + #Use the following code to replace NA's in the dataframe with the correct corresponding values and removing all unnecessary columns + + standings_data$value <- ifelse(is.na(standings_data$value) & !is.na(standings_data$summary), standings_data$summary, standings_data$value) + + standings_data <- standings_data %>% + dplyr::select(.data$.id, .data$type, .data$value) + + #Use pivot_wider to transpose the dataframe so that we now have a standings row for each team + + standings_data <- standings_data %>% + tidyr::pivot_wider(names_from = .data$type, values_from = .data$value) + + standings_data <- standings_data %>% + dplyr::select(-.data$.id) + + #joining the 2 dataframes together to create a standings table + + standings <- cbind(teams, standings_data) + }, + error = function(e) { + message(glue::glue("{Sys.time()}: Invalid arguments or no standings data available!")) + }, + warning = function(w) { + }, + finally = { + } + + ) + return(standings) +} #' @import utils utils::globalVariables(c("where")) diff --git a/R/wbb_pbp.R b/R/wbb_pbp.R index 4477153d..67f0a0ae 100644 --- a/R/wbb_pbp.R +++ b/R/wbb_pbp.R @@ -12,6 +12,11 @@ NULL #' @param qs Wheter to use the function [qs::qdeserialize()] for more efficient loading. #' @import furrr #' @export +#' @examples +#' \dontrun{ +#' future::plan("multisession") +#' load_wbb_pbp(2002:2021) +#' } load_wbb_pbp <- function(seasons, ..., qs = FALSE) { options(stringsAsFactors = FALSE) options(scipen = 999) @@ -74,6 +79,169 @@ wbb_single_season <- function(season, p, dbConnection = NULL, tablename = NULL, p(sprintf("season=%g", season)) return(out) } +#' **Load wehoop women's college basketball team box scores** +#' @name load_wbb_team_box +NULL +#' @title +#' **Load cleaned women's college basketball team box scores from the data repo** +#' @rdname load_wbb_team_box +#' @description helper that loads multiple seasons from the data repo either into memory +#' or writes it into a db using some forwarded arguments in the dots +#' @param seasons A vector of 4-digit years associated with given women's college basketball seasons. +#' @param ... Additional arguments passed to an underlying function that writes +#' the season data into a database (used by \code{\link[=update_wbb_db]{update_wbb_db()}}). +#' @param qs Wheter to use the function [qs::qdeserialize()] for more efficient loading. +#' @import furrr +#' @export +#' @examples +#' \dontrun{ +#' future::plan("multisession") +#' load_wbb_team_box(2002:2021) +#' } +load_wbb_team_box <- function(seasons, ..., qs = FALSE) { + options(stringsAsFactors = FALSE) + options(scipen = 999) + dots <- rlang::dots_list(...) + + if (all(c("dbConnection", "tablename") %in% names(dots))) in_db <- TRUE else in_db <- FALSE + + if (isTRUE(qs) && !is_installed("qs")) { + usethis::ui_stop("Package {usethis::ui_value('qs')} required for argument {usethis::ui_value('qs = TRUE')}. Please install it.") + } + + most_recent <- most_recent_wbb_season() + + if (!all(seasons %in% 2002:most_recent)) { + usethis::ui_stop("Please pass valid seasons between 2002 and {most_recent}") + } + + if (length(seasons) > 1 && is_sequential() && isFALSE(in_db)) { + usethis::ui_info(c( + "It is recommended to use parallel processing when trying to load multiple seasons.", + "Please consider running {usethis::ui_code('future::plan(\"multisession\")')}!", + "Will go on sequentially..." + )) + } + + + p <- progressr::progressor(along = seasons) + + if (isFALSE(in_db)) { + out <- furrr::future_map_dfr(seasons, wbb_team_box_single_season, p = p, qs = qs) + } + + if (isTRUE(in_db)) { + purrr::walk(seasons, wbb_team_box_single_season, p, ..., qs = qs) + out <- NULL + } + + return(out) +} + +wbb_team_box_single_season <- function(season, p, dbConnection = NULL, tablename = NULL, qs = FALSE) { + if (isTRUE(qs)) { + + .url <- glue::glue("https://github.com/saiemgilani/wehoop-data/blob/master/wbb/team_box/rds/team_box_{season}.qs") + pbp <- qs_from_url(.url) + + } + if (isFALSE(qs)) { + .url <- glue::glue("https://raw.githubusercontent.com/saiemgilani/wehoop-data/master/wbb/team_box/rds/team_box_{season}.rds") + con <- url(.url) + pbp <- readRDS(con) + close(con) + } + if (!is.null(dbConnection) && !is.null(tablename)) { + DBI::dbWriteTable(dbConnection, tablename, pbp, append = TRUE) + out <- NULL + } else { + out <- pbp + } + p(sprintf("season=%g", season)) + return(out) +} + +#' **Load wehoop women's college basketball player box scores** +#' @name load_wbb_player_box +NULL +#' @title +#' **Load cleaned women's college basketball player box scores from the data repo** +#' @rdname load_wbb_player_box +#' @description helper that loads multiple seasons from the data repo either into memory +#' or writes it into a db using some forwarded arguments in the dots +#' @param seasons A vector of 4-digit years associated with given women's college basketball seasons. +#' @param ... Additional arguments passed to an underlying function that writes +#' the season data into a database (used by \code{\link[=update_wbb_db]{update_wbb_db()}}). +#' @param qs Wheter to use the function [qs::qdeserialize()] for more efficient loading. +#' @import furrr +#' @export +#' @examples +#' \dontrun{ +#' future::plan("multisession") +#' load_wbb_player_box(2002:2021) +#' } +load_wbb_player_box <- function(seasons, ..., qs = FALSE) { + options(stringsAsFactors = FALSE) + options(scipen = 999) + dots <- rlang::dots_list(...) + + if (all(c("dbConnection", "tablename") %in% names(dots))) in_db <- TRUE else in_db <- FALSE + + if (isTRUE(qs) && !is_installed("qs")) { + usethis::ui_stop("Package {usethis::ui_value('qs')} required for argument {usethis::ui_value('qs = TRUE')}. Please install it.") + } + + most_recent <- most_recent_wbb_season() + + if (!all(seasons %in% 2002:most_recent)) { + usethis::ui_stop("Please pass valid seasons between 2002 and {most_recent}") + } + + if (length(seasons) > 1 && is_sequential() && isFALSE(in_db)) { + usethis::ui_info(c( + "It is recommended to use parallel processing when trying to load multiple seasons.", + "Please consider running {usethis::ui_code('future::plan(\"multisession\")')}!", + "Will go on sequentially..." + )) + } + + + p <- progressr::progressor(along = seasons) + + if (isFALSE(in_db)) { + out <- furrr::future_map_dfr(seasons, wbb_player_box_single_season, p = p, qs = qs) + } + + if (isTRUE(in_db)) { + purrr::walk(seasons, wbb_player_box_single_season, p, ..., qs = qs) + out <- NULL + } + + return(out) +} + +wbb_player_box_single_season <- function(season, p, dbConnection = NULL, tablename = NULL, qs = FALSE) { + if (isTRUE(qs)) { + + .url <- glue::glue("https://github.com/saiemgilani/wehoop-data/blob/master/wbb/player_box/rds/player_box_{season}.qs") + pbp <- qs_from_url(.url) + + } + if (isFALSE(qs)) { + .url <- glue::glue("https://raw.githubusercontent.com/saiemgilani/wehoop-data/master/wbb/player_box/rds/player_box_{season}.rds") + con <- url(.url) + pbp <- readRDS(con) + close(con) + } + if (!is.null(dbConnection) && !is.null(tablename)) { + DBI::dbWriteTable(dbConnection, tablename, pbp, append = TRUE) + out <- NULL + } else { + out <- pbp + } + p(sprintf("season=%g", season)) + return(out) +} # load games file load_wbb_games <- function(){ @@ -128,7 +296,7 @@ load_wbb_games <- function(){ #' @import furrr #' @export update_wbb_db <- function(dbdir = ".", - dbname = "wbb_pbp_db", + dbname = "wehoop_db", tblname = "wehoop_wbb_pbp", force_rebuild = FALSE, db_connection = NULL) { @@ -166,7 +334,7 @@ update_wbb_db <- function(dbdir = ".", build_wbb_db(tblname, connection, rebuild = force_rebuild) } - # get completed games using Lee's file (thanks Lee!) + # get completed games user_message("Checking for missing completed games...", "todo") completed_games <- load_wbb_games() %>% # completed games since 2002, excluding the broken games diff --git a/R/wnba_pbp.R b/R/wnba_pbp.R index ce573e14..e7a96282 100644 --- a/R/wnba_pbp.R +++ b/R/wnba_pbp.R @@ -12,6 +12,11 @@ NULL #' @param qs Whether to use the function [qs::qdeserialize()] for more efficient loading. #' @import furrr #' @export +#' @examples +#' \dontrun{ +#' future::plan("multisession") +#' load_wnba_pbp(2002:2021) +#' } load_wnba_pbp <- function(seasons, ..., qs = FALSE) { options(stringsAsFactors = FALSE) options(scipen = 999) @@ -74,6 +79,169 @@ wnba_single_season <- function(season, p, dbConnection = NULL, tablename = NULL, p(sprintf("season=%g", season)) return(out) } +#' **Load wehoop WNBA team box scores** +#' @name load_wnba_team_box +NULL +#' @title +#' **Load cleaned WNBA team box scores from the data repo** +#' @rdname load_wnba_team_box +#' @description helper that loads multiple seasons from the data repo either into memory +#' or writes it into a db using some forwarded arguments in the dots +#' @param seasons A vector of 4-digit years associated with given WNBA seasons. +#' @param ... Additional arguments passed to an underlying function that writes +#' the season data into a database (used by \code{\link[=update_wnba_db]{update_wnba_db()}}). +#' @param qs Wheter to use the function [qs::qdeserialize()] for more efficient loading. +#' @import furrr +#' @export +#' @examples +#' \dontrun{ +#' future::plan("multisession") +#' load_wnba_team_box(2002:2021) +#' } +load_wnba_team_box <- function(seasons, ..., qs = FALSE) { + options(stringsAsFactors = FALSE) + options(scipen = 999) + dots <- rlang::dots_list(...) + + if (all(c("dbConnection", "tablename") %in% names(dots))) in_db <- TRUE else in_db <- FALSE + + if (isTRUE(qs) && !is_installed("qs")) { + usethis::ui_stop("Package {usethis::ui_value('qs')} required for argument {usethis::ui_value('qs = TRUE')}. Please install it.") + } + + most_recent <- most_recent_wnba_season() + + if (!all(seasons %in% 2002:most_recent)) { + usethis::ui_stop("Please pass valid seasons between 2002 and {most_recent}") + } + + if (length(seasons) > 1 && is_sequential() && isFALSE(in_db)) { + usethis::ui_info(c( + "It is recommended to use parallel processing when trying to load multiple seasons.", + "Please consider running {usethis::ui_code('future::plan(\"multisession\")')}!", + "Will go on sequentially..." + )) + } + + + p <- progressr::progressor(along = seasons) + + if (isFALSE(in_db)) { + out <- furrr::future_map_dfr(seasons, wnba_team_box_single_season, p = p, qs = qs) + } + + if (isTRUE(in_db)) { + purrr::walk(seasons, wnba_team_box_single_season, p, ..., qs = qs) + out <- NULL + } + + return(out) +} + +wnba_team_box_single_season <- function(season, p, dbConnection = NULL, tablename = NULL, qs = FALSE) { + if (isTRUE(qs)) { + + .url <- glue::glue("https://github.com/saiemgilani/wehoop-data/blob/master/wnba/team_box/rds/team_box_{season}.qs") + pbp <- qs_from_url(.url) + + } + if (isFALSE(qs)) { + .url <- glue::glue("https://raw.githubusercontent.com/saiemgilani/wehoop-data/master/wnba/team_box/rds/team_box_{season}.rds") + con <- url(.url) + pbp <- readRDS(con) + close(con) + } + if (!is.null(dbConnection) && !is.null(tablename)) { + DBI::dbWriteTable(dbConnection, tablename, pbp, append = TRUE) + out <- NULL + } else { + out <- pbp + } + p(sprintf("season=%g", season)) + return(out) +} + +#' **Load wehoop WNBA player box scores** +#' @name load_wnba_player_box +NULL +#' @title +#' **Load cleaned WNBA player box scores from the data repo** +#' @rdname load_wnba_player_box +#' @description helper that loads multiple seasons from the data repo either into memory +#' or writes it into a db using some forwarded arguments in the dots +#' @param seasons A vector of 4-digit years associated with given WNBA seasons. +#' @param ... Additional arguments passed to an underlying function that writes +#' the season data into a database (used by \code{\link[=update_wnba_db]{update_wnba_db()}}). +#' @param qs Wheter to use the function [qs::qdeserialize()] for more efficient loading. +#' @import furrr +#' @export +#' @examples +#' \dontrun{ +#' future::plan("multisession") +#' load_wnba_player_box(2002:2021) +#' } +load_wnba_player_box <- function(seasons, ..., qs = FALSE) { + options(stringsAsFactors = FALSE) + options(scipen = 999) + dots <- rlang::dots_list(...) + + if (all(c("dbConnection", "tablename") %in% names(dots))) in_db <- TRUE else in_db <- FALSE + + if (isTRUE(qs) && !is_installed("qs")) { + usethis::ui_stop("Package {usethis::ui_value('qs')} required for argument {usethis::ui_value('qs = TRUE')}. Please install it.") + } + + most_recent <- most_recent_wnba_season() + + if (!all(seasons %in% 2002:most_recent)) { + usethis::ui_stop("Please pass valid seasons between 2002 and {most_recent}") + } + + if (length(seasons) > 1 && is_sequential() && isFALSE(in_db)) { + usethis::ui_info(c( + "It is recommended to use parallel processing when trying to load multiple seasons.", + "Please consider running {usethis::ui_code('future::plan(\"multisession\")')}!", + "Will go on sequentially..." + )) + } + + + p <- progressr::progressor(along = seasons) + + if (isFALSE(in_db)) { + out <- furrr::future_map_dfr(seasons, wnba_player_box_single_season, p = p, qs = qs) + } + + if (isTRUE(in_db)) { + purrr::walk(seasons, wnba_player_box_single_season, p, ..., qs = qs) + out <- NULL + } + + return(out) +} + +wnba_player_box_single_season <- function(season, p, dbConnection = NULL, tablename = NULL, qs = FALSE) { + if (isTRUE(qs)) { + + .url <- glue::glue("https://github.com/saiemgilani/wehoop-data/blob/master/wnba/player_box/rds/player_box_{season}.qs") + pbp <- qs_from_url(.url) + + } + if (isFALSE(qs)) { + .url <- glue::glue("https://raw.githubusercontent.com/saiemgilani/wehoop-data/master/wnba/player_box/rds/player_box_{season}.rds") + con <- url(.url) + pbp <- readRDS(con) + close(con) + } + if (!is.null(dbConnection) && !is.null(tablename)) { + DBI::dbWriteTable(dbConnection, tablename, pbp, append = TRUE) + out <- NULL + } else { + out <- pbp + } + p(sprintf("season=%g", season)) + return(out) +} # load games file load_wnba_games <- function(){ @@ -128,7 +296,7 @@ load_wnba_games <- function(){ #' @import furrr #' @export update_wnba_db <- function(dbdir = ".", - dbname = "wnba_pbp_db", + dbname = "wehoop_db", tblname = "wehoop_wnba_pbp", force_rebuild = FALSE, db_connection = NULL) { @@ -166,7 +334,7 @@ update_wnba_db <- function(dbdir = ".", build_wnba_db(tblname, connection, rebuild = force_rebuild) } - # get completed games using Lee's file (thanks Lee!) + # get completed games user_message("Checking for missing completed games...", "todo") completed_games <- load_wnba_games() %>% # completed games since 2002, excluding the broken games diff --git a/README.Rmd b/README.Rmd index 913077a7..cd60b98f 100644 --- a/README.Rmd +++ b/README.Rmd @@ -125,7 +125,26 @@ For more information on the package and function reference, please see the [**` [**Full News on Releases**](https://saiemgilani.github.io/wehoop/news/index.html) -# **wehoop 0.9.2** +# **wehoop 1.0.0** +### **Add team box score loaders** +- [```wehoop::load_wbb_team_box()```](https://saiemgilani.github.io/wehoop/reference/load_wbb_team_box.html) function added +- [```wehoop::load_wnba_team_box()```](https://saiemgilani.github.io/wehoop/reference/load_wnba_team_box.html) function added + +### **Add player box score loaders** +- [```wehoop::load_wbb_player_box()```](https://saiemgilani.github.io/wehoop/reference/load_wbb_player_box.html) function added +- [```wehoop::load_wnba_player_box()```](https://saiemgilani.github.io/wehoop/reference/load_wnba_player_box.html) function added + +### **Standings functions** +- [```wehoop::espn_wnba_standings()```](https://saiemgilani.github.io/wehoop/reference/espn_wnba_standings.html) +- [```wehoop::espn_wbb_standings()```](https://saiemgilani.github.io/wehoop/reference/espn_wbb_standings.html) + +### **Getting Started vignette** +- [Getting started with wehoop data](https://saiemgilani.github.io/wehoop/articles/getting-started-wehoop.html) + +# +
View more version news + +## **wehoop 0.9.2** - Added [```wehoop::espn_wbb_conferences()```](https://saiemgilani.github.io/wehoop/reference/espn_wbb_conferences.html) function ### **Quick fix for update db functions** @@ -133,9 +152,6 @@ For more information on the package and function reference, please see the [**` ### **Dependency pruning** This update is a non-user facing change to package dependencies to shrink the list of dependencies. -# -
View more version news - ## **wehoop 0.9.1** ### **Clean names and team returns** - All functions have now been given the [```janitor::clean_names()```](https://rdrr.io/cran/janitor/man/clean_names.html) treatment diff --git a/_pkgdown.yml b/_pkgdown.yml index 69fea16d..6ca1e7f6 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -21,6 +21,9 @@ home: description: Functions to Access Women's Basketball Play by Play Data icon: fa-home href: index.html + links: + - text: Getting started with wehoop + href: articles/getting-started-wehoop.html navbar: structure: left: [home, intro, reference, articles, news, games, network, data, repo] @@ -54,6 +57,8 @@ navbar: menu: - text: Vignettes href: articles/index.html + - text: Getting started + href: articles/getting-started-wehoop.html network: icon: "fas fa-project-diagram" text: " SDV" @@ -82,11 +87,15 @@ reference: desc: Functions exported by wehoop to access the wehoop-data repository's Women's College Basketball Data contents: - '`load_wbb_pbp`' + - '`load_wbb_team_box`' + - '`load_wbb_player_box`' - '`update_wbb_db`' - subtitle: WNBA Data Functions desc: Functions exported by wehoop to access the wehoop-data repository's WNBA Data contents: - '`load_wnba_pbp`' + - '`load_wnba_team_box`' + - '`load_wnba_player_box`' - '`update_wnba_db`' - title: ESPN Data - subtitle: Women's College Basketball Data Functions diff --git a/docs/404.html b/docs/404.html index 0eb2296c..a8e86478 100644 --- a/docs/404.html +++ b/docs/404.html @@ -49,7 +49,10 @@ - + + + + @@ -91,7 +94,7 @@ wehoop - 0.9.0 + 1.0.0 @@ -129,6 +132,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -154,7 +160,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index 947dea9f..d02014b8 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -49,7 +49,10 @@ - + + + + @@ -91,7 +94,7 @@ wehoop - 0.3.0 + 1.0.0 @@ -129,6 +132,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -154,7 +160,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 2ad5818a..92a9eb1e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -49,7 +49,10 @@ - + + + + @@ -91,7 +94,7 @@ wehoop - 0.3.0 + 1.0.0 @@ -129,6 +132,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -154,7 +160,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 60913656..603bea21 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -49,7 +49,10 @@ - + + + + @@ -91,7 +94,7 @@ wehoop - 0.3.0 + 1.0.0 @@ -129,6 +132,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -154,7 +160,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR diff --git a/docs/authors.html b/docs/authors.html index 21894de6..da64706f 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -49,7 +49,10 @@ - + + + + @@ -91,7 +94,7 @@ wehoop - 0.3.0 + 1.0.0 @@ -129,6 +132,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -154,7 +160,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR diff --git a/docs/index.html b/docs/index.html index fa96f3a2..c6b6b3f1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,7 +20,10 @@ - + + + + -

    wehoop is an R package for working with women’s college and professional basketball data. A scraping and aggregating interface for ESPN’s women’s college basketball and WNBA statistics. It provides users with the capability to access the API’s game play-by-plays, box scores, standings and results to analyze the data for themselves.

    +

    wehoop is an R package for working with women’s college and professional basketball data. The package has functions to access live play by play and box score data from ESPN with shot locations when available.

    +

    A scraping and aggregating interface for ESPN’s women’s college basketball and WNBA statistics. It provides users with the capability to access the API’s game play-by-plays, box scores, standings and results to analyze the data for themselves.

    Installation

    @@ -197,10 +204,64 @@

    Full News on Releases

    -
    +

    -wehoop 0.3.0 +wehoop 0.9.2 +

    +
    +

    +Quick fix for update db functions +

    +
    +
    +

    +Dependency pruning +

    +

    This update is a non-user facing change to package dependencies to shrink the list of dependencies.

    +
    +
    +
    +

    +

    View more version news

    +
    +
    +
    +

    +wehoop 0.9.1 +

    +
    +

    +Clean names and team returns +

    + +
    +
    +
    +

    +wehoop 0.9.0

    +
    +

    +Loading capabilities added to the package +

    + +
    +
    +

    +wehoop 0.3.0 +

    Dependencies @@ -235,28 +296,19 @@

    Test coverage

      -
    • Added tests for all ESPN functions
    • -
    -
    -
    -

    -Function Naming Convention Change -

    -
      -
    • Similarly, data and metrics sourced from ESPN will begin with espn_ as opposed to wbb_ or wnba_.

    • -
    • Data sourced directly from the NCAA website will start the function with ncaa_

    • +
    • Added tests for all ESPN functions ### Function Naming Convention Change +
    • +
    • Similarly, data and metrics sourced from ESPN will begin with espn_ as opposed to wbb_ or wnba_.
    • +
    • Data sourced directly from the NCAA website will start the function with ncaa_ +
    -
    -

    -

    View more version news

    v0.2.0: Support for ESPN’s WNBA game data

    -

    See the following six functions:

    +

    See the following six functions: - wehoop::wnba_espn_game_all()

    @@ -308,15 +362,6 @@

    View More

    --------- @@ -327,13 +372,13 @@

    - + - + - - + +
    issue iconclosed
    24 remove rankings and conferences functions for nowTeams fix saiemgilani2021-04-062021-04-06 17:46:252021-05-132021-05-13 02:25:54


    @@ -355,6 +400,8 @@

    Links

    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index c4b7533c..90a75da5 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,8 +1,9 @@ pandoc: 2.9.2.1 pkgdown: 1.6.1 pkgdown_sha: ~ -articles: {} -last_built: 2021-05-10T12:33Z +articles: + getting-started-wehoop: getting-started-wehoop.html +last_built: 2021-05-24T18:53Z urls: reference: https://saiemgilani.github.io/wehoop/reference article: https://saiemgilani.github.io/wehoop/articles diff --git a/docs/reference/espn_wbb_game_all.html b/docs/reference/espn_wbb_game_all.html index 0eb0929e..7d78fac9 100644 --- a/docs/reference/espn_wbb_game_all.html +++ b/docs/reference/espn_wbb_game_all.html @@ -50,7 +50,10 @@ - + + + + @@ -92,7 +95,7 @@ wehoop - 0.3.0 + 1.0.0
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -215,7 +221,7 @@

    Get ESPN women's college basketball game data (play-by-play, team and player

    Get ESPN women's college basketball game data (play-by-play, team and player box)

    -
    espn_wbb_game_all(game_id, verbose = FALSE)
    +
    espn_wbb_game_all(game_id)

    Arguments

    @@ -224,10 +230,6 @@

    Arg

    - - - -
    game_id

    Game ID

    verbose

    Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function

    Author

    @@ -235,30 +237,30 @@

    AuthorSaiem Gilani

    Examples

    -
    - espn_wbb_game_all(game_id = 401276115) +
    espn_wbb_game_all(game_id = 401276115)
    #> $Plays #> # A tibble: 386 x 19 -#> shootingPlay sequenceNumber homeScore scoringPlay awayScore id text -#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> -#> 1 FALSE 101899901 0 FALSE 0 401276~ Jump Bal~ -#> 2 TRUE 101904901 2 TRUE 0 401276~ Morgan J~ -#> 3 TRUE 101907701 2 TRUE 3 401276~ Kianna S~ -#> 4 TRUE 101914901 2 FALSE 3 401276~ Valencia~ -#> 5 FALSE 101914902 2 FALSE 3 401276~ Morgan J~ -#> 6 TRUE 101915701 5 TRUE 3 401276~ Kourtney~ -#> 7 TRUE 101919001 5 FALSE 3 401276~ Dana Eva~ -#> 8 FALSE 101919002 5 FALSE 3 401276~ Kianna S~ -#> 9 TRUE 101919501 5 TRUE 5 401276~ Mykasa R~ -#> 10 TRUE 101924601 5 FALSE 5 401276~ Morgan J~ -#> # ... with 376 more rows, and 12 more variables: scoreValue <int>, -#> # period.displayValue <chr>, period.number <int>, coordinate.x <int>, -#> # coordinate.y <int>, clock.displayValue <chr>, team.id <chr>, type.id <chr>, -#> # type.text <chr>, play.id <chr>, athlete.id.1 <chr>, athlete.id.2 <chr> +#> shooting_play sequence_number home_score scoring_play away_score id text +#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> +#> 1 FALSE 101899901 0 FALSE 0 40127~ Jump~ +#> 2 TRUE 101904901 2 TRUE 0 40127~ Morg~ +#> 3 TRUE 101907701 2 TRUE 3 40127~ Kian~ +#> 4 TRUE 101914901 2 FALSE 3 40127~ Vale~ +#> 5 FALSE 101914902 2 FALSE 3 40127~ Morg~ +#> 6 TRUE 101915701 5 TRUE 3 40127~ Kour~ +#> 7 TRUE 101919001 5 FALSE 3 40127~ Dana~ +#> 8 FALSE 101919002 5 FALSE 3 40127~ Kian~ +#> 9 TRUE 101919501 5 TRUE 5 40127~ Myka~ +#> 10 TRUE 101924601 5 FALSE 5 40127~ Morg~ +#> # ... with 376 more rows, and 12 more variables: score_value <int>, +#> # period_display_value <chr>, period_number <int>, coordinate_x <int>, +#> # coordinate_y <int>, clock_display_value <chr>, team_id <chr>, +#> # type_id <chr>, type_text <chr>, play_id <chr>, athlete_id_1 <chr>, +#> # athlete_id_2 <chr> #> #> $Team #> # A tibble: 22 x 3 -#> Home label Away +#> home label away #> <chr> <chr> <chr> #> 1 Florida State Team Louisville #> 2 19-60 FG 21-60 @@ -273,67 +275,67 @@

    Examp #> # ... with 12 more rows #> #> $Player -#> athlete.displayName team.shortDisplayName MIN FG 3PT FT OREB DREB REB -#> 1 Olivia Cochran Louisville 19 6-10 0-0 0-2 3 6 9 -#> 2 Hailey Van Lith Louisville 22 1-7 0-1 3-6 3 5 8 -#> 3 Mykasa Robinson Louisville 26 1-2 0-0 1-2 2 3 5 -#> 4 Kianna Smith Louisville 35 3-9 2-6 2-2 1 3 4 -#> 5 Dana Evans Louisville 38 5-21 1-9 2-2 1 1 2 -#> 6 Malea Williams Louisville 1 0-0 0-0 0-0 0 0 0 -#> 7 Elizabeth Dixon Louisville 24 3-5 0-0 2-4 1 4 5 -#> 8 Norika Konno Louisville 7 0-0 0-0 0-0 0 2 2 -#> 9 Ahlana Smith Louisville 2 0-0 0-0 0-0 0 0 0 -#> 10 Elizabeth Balogun Louisville 26 2-6 0-4 4-4 2 2 4 -#> 11 Valencia Myers Florida State 26 3-9 0-0 3-5 5 2 7 -#> 12 Sammie Puisis Florida State 29 0-5 0-4 0-0 1 2 3 -#> 13 Kourtney Weber Florida State 32 6-11 2-5 0-2 4 1 5 -#> 14 Bianca Jackson Florida State 27 1-8 0-0 5-6 0 2 2 -#> 15 Morgan Jones Florida State 29 7-13 0-0 12-15 3 7 10 -#> 16 Savannah Wilkinson Florida State 10 0-0 0-0 0-0 0 1 1 -#> 17 River Baldwin Florida State 14 1-3 0-0 1-2 2 3 5 -#> 18 Sayawni Lassiter Florida State 11 0-4 0-3 1-2 3 2 5 -#> 19 Tiana England Florida State 22 1-7 1-1 5-6 0 3 3 -#> AST STL BLK TO PF PTS starter ejected didNotPlay active athlete.jersey -#> 1 1 0 0 1 2 12 TRUE FALSE FALSE FALSE 44 -#> 2 2 2 0 1 4 5 TRUE FALSE FALSE FALSE 10 -#> 3 0 1 0 3 4 3 TRUE FALSE FALSE FALSE 5 -#> 4 3 0 0 1 4 10 TRUE FALSE FALSE FALSE 14 -#> 5 5 1 0 2 2 13 TRUE FALSE FALSE FALSE 1 -#> 6 0 0 0 0 1 0 FALSE FALSE FALSE FALSE 3 -#> 7 0 0 4 1 4 8 FALSE FALSE FALSE FALSE 22 -#> 8 0 0 0 1 2 0 FALSE FALSE FALSE FALSE 11 -#> 9 0 0 0 0 0 0 FALSE FALSE FALSE FALSE 2 -#> 10 2 1 0 1 3 8 FALSE FALSE FALSE FALSE 4 -#> 11 0 0 1 0 5 9 TRUE FALSE FALSE FALSE 32 -#> 12 2 1 0 0 2 0 TRUE FALSE FALSE FALSE 2 -#> 13 0 1 1 2 2 14 TRUE FALSE FALSE FALSE 10 -#> 14 1 0 0 2 2 7 TRUE FALSE FALSE FALSE 0 -#> 15 2 1 2 3 3 26 TRUE FALSE FALSE FALSE 24 -#> 16 0 1 0 1 1 0 FALSE FALSE FALSE FALSE 12 -#> 17 1 1 0 2 3 3 FALSE FALSE FALSE FALSE 1 -#> 18 1 1 0 0 1 1 FALSE FALSE FALSE FALSE 3 -#> 19 2 0 1 1 2 8 FALSE FALSE FALSE FALSE 23 -#> athlete.id athlete.shortName -#> 1 4433426 O. Cochran -#> 2 4433412 H. Van Lith -#> 3 4398604 M. Robinson -#> 4 4281919 K. Smith -#> 5 4281190 D. Evans -#> 6 4703211 M. Williams -#> 7 4594384 E. Dixon -#> 8 4433094 N. Konno -#> 9 4398835 A. Smith -#> 10 4398589 E. Balogun -#> 11 4398583 V. Myers -#> 12 4432862 S. Puisis -#> 13 4398582 K. Weber -#> 14 4280885 B. Jackson -#> 15 2984250 M. Jones -#> 16 4281175 S. Wilkinson -#> 17 4433304 R. Baldwin -#> 18 4281174 S. Lassiter -#> 19 4068155 T. England -#> athlete.headshot.href +#> athlete_display_name team_short_display_name min fg fg3 ft oreb dreb +#> 1 Olivia Cochran Louisville 19 6-10 0-0 0-2 3 6 +#> 2 Hailey Van Lith Louisville 22 1-7 0-1 3-6 3 5 +#> 3 Mykasa Robinson Louisville 26 1-2 0-0 1-2 2 3 +#> 4 Kianna Smith Louisville 35 3-9 2-6 2-2 1 3 +#> 5 Dana Evans Louisville 38 5-21 1-9 2-2 1 1 +#> 6 Malea Williams Louisville 1 0-0 0-0 0-0 0 0 +#> 7 Elizabeth Dixon Louisville 24 3-5 0-0 2-4 1 4 +#> 8 Norika Konno Louisville 7 0-0 0-0 0-0 0 2 +#> 9 Ahlana Smith Louisville 2 0-0 0-0 0-0 0 0 +#> 10 Elizabeth Balogun Louisville 26 2-6 0-4 4-4 2 2 +#> 11 Valencia Myers Florida State 26 3-9 0-0 3-5 5 2 +#> 12 Sammie Puisis Florida State 29 0-5 0-4 0-0 1 2 +#> 13 Kourtney Weber Florida State 32 6-11 2-5 0-2 4 1 +#> 14 Bianca Jackson Florida State 27 1-8 0-0 5-6 0 2 +#> 15 Morgan Jones Florida State 29 7-13 0-0 12-15 3 7 +#> 16 Savannah Wilkinson Florida State 10 0-0 0-0 0-0 0 1 +#> 17 River Baldwin Florida State 14 1-3 0-0 1-2 2 3 +#> 18 Sayawni Lassiter Florida State 11 0-4 0-3 1-2 3 2 +#> 19 Tiana England Florida State 22 1-7 1-1 5-6 0 3 +#> reb ast stl blk to pf pts starter ejected did_not_play active athlete_jersey +#> 1 9 1 0 0 1 2 12 TRUE FALSE FALSE FALSE 44 +#> 2 8 2 2 0 1 4 5 TRUE FALSE FALSE FALSE 10 +#> 3 5 0 1 0 3 4 3 TRUE FALSE FALSE FALSE 5 +#> 4 4 3 0 0 1 4 10 TRUE FALSE FALSE FALSE 14 +#> 5 2 5 1 0 2 2 13 TRUE FALSE FALSE FALSE 1 +#> 6 0 0 0 0 0 1 0 FALSE FALSE FALSE FALSE 3 +#> 7 5 0 0 4 1 4 8 FALSE FALSE FALSE FALSE 22 +#> 8 2 0 0 0 1 2 0 FALSE FALSE FALSE FALSE 11 +#> 9 0 0 0 0 0 0 0 FALSE FALSE FALSE FALSE 2 +#> 10 4 2 1 0 1 3 8 FALSE FALSE FALSE FALSE 4 +#> 11 7 0 0 1 0 5 9 TRUE FALSE FALSE FALSE 32 +#> 12 3 2 1 0 0 2 0 TRUE FALSE FALSE FALSE 2 +#> 13 5 0 1 1 2 2 14 TRUE FALSE FALSE FALSE 10 +#> 14 2 1 0 0 2 2 7 TRUE FALSE FALSE FALSE 0 +#> 15 10 2 1 2 3 3 26 TRUE FALSE FALSE FALSE 24 +#> 16 1 0 1 0 1 1 0 FALSE FALSE FALSE FALSE 12 +#> 17 5 1 1 0 2 3 3 FALSE FALSE FALSE FALSE 1 +#> 18 5 1 1 0 0 1 1 FALSE FALSE FALSE FALSE 3 +#> 19 3 2 0 1 1 2 8 FALSE FALSE FALSE FALSE 23 +#> athlete_id athlete_short_name +#> 1 4433426 O. Cochran +#> 2 4433412 H. Van Lith +#> 3 4398604 M. Robinson +#> 4 4281919 K. Smith +#> 5 4281190 D. Evans +#> 6 4703211 M. Williams +#> 7 4594384 E. Dixon +#> 8 4433094 N. Konno +#> 9 4398835 A. Smith +#> 10 4398589 E. Balogun +#> 11 4398583 V. Myers +#> 12 4432862 S. Puisis +#> 13 4398582 K. Weber +#> 14 4280885 B. Jackson +#> 15 2984250 M. Jones +#> 16 4281175 S. Wilkinson +#> 17 4433304 R. Baldwin +#> 18 4281174 S. Lassiter +#> 19 4068155 T. England +#> athlete_headshot_href #> 1 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4433426.png #> 2 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4433412.png #> 3 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4398604.png @@ -353,7 +355,7 @@

    Examp #> 17 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4433304.png #> 18 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4281174.png #> 19 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4068155.png -#> athlete.position.name athlete.position.abbreviation team.name +#> athlete_position_name athlete_position_abbreviation team_name #> 1 Forward F Cardinals #> 2 Guard G Cardinals #> 3 Guard G Cardinals @@ -373,7 +375,7 @@

    Examp #> 17 Center C Seminoles #> 18 Guard G Seminoles #> 19 Guard G Seminoles -#> team.logo team.id team.abbreviation +#> team_logo team_id team_abbreviation #> 1 https://a.espncdn.com/i/teamlogos/ncaa/500/97.png 97 LOU #> 2 https://a.espncdn.com/i/teamlogos/ncaa/500/97.png 97 LOU #> 3 https://a.espncdn.com/i/teamlogos/ncaa/500/97.png 97 LOU @@ -393,28 +395,27 @@

    Examp #> 17 https://a.espncdn.com/i/teamlogos/ncaa/500/52.png 52 FSU #> 18 https://a.espncdn.com/i/teamlogos/ncaa/500/52.png 52 FSU #> 19 https://a.espncdn.com/i/teamlogos/ncaa/500/52.png 52 FSU -#> team.color team.alternateColor -#> 1 ad000a cccccc -#> 2 ad000a cccccc -#> 3 ad000a cccccc -#> 4 ad000a cccccc -#> 5 ad000a cccccc -#> 6 ad000a cccccc -#> 7 ad000a cccccc -#> 8 ad000a cccccc -#> 9 ad000a cccccc -#> 10 ad000a cccccc -#> 11 782F40 ceb888 -#> 12 782F40 ceb888 -#> 13 782F40 ceb888 -#> 14 782F40 ceb888 -#> 15 782F40 ceb888 -#> 16 782F40 ceb888 -#> 17 782F40 ceb888 -#> 18 782F40 ceb888 -#> 19 782F40 ceb888 -#>

    -
    +#> team_color team_alternate_color +#> 1 ad000a cccccc +#> 2 ad000a cccccc +#> 3 ad000a cccccc +#> 4 ad000a cccccc +#> 5 ad000a cccccc +#> 6 ad000a cccccc +#> 7 ad000a cccccc +#> 8 ad000a cccccc +#> 9 ad000a cccccc +#> 10 ad000a cccccc +#> 11 782F40 ceb888 +#> 12 782F40 ceb888 +#> 13 782F40 ceb888 +#> 14 782F40 ceb888 +#> 15 782F40 ceb888 +#> 16 782F40 ceb888 +#> 17 782F40 ceb888 +#> 18 782F40 ceb888 +#> 19 782F40 ceb888 +#>
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -215,7 +221,7 @@

    Get ESPN women's college basketball play by play data

    Get ESPN women's college basketball play by play data

    -
    espn_wbb_pbp(game_id, verbose = FALSE)
    +
    espn_wbb_pbp(game_id)

    Arguments

    @@ -224,10 +230,6 @@

    Arg

    - - - -
    game_id

    Game ID

    verbose

    Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function

    Author

    @@ -235,26 +237,25 @@

    AuthorSaiem Gilani

    Examples

    -
    - espn_wbb_pbp(game_id = 401276115) +
    espn_wbb_pbp(game_id = 401276115)
    #> # A tibble: 386 x 19 -#> shootingPlay sequenceNumber homeScore scoringPlay awayScore id text -#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> -#> 1 FALSE 101899901 0 FALSE 0 401276~ Jump Bal~ -#> 2 TRUE 101904901 2 TRUE 0 401276~ Morgan J~ -#> 3 TRUE 101907701 2 TRUE 3 401276~ Kianna S~ -#> 4 TRUE 101914901 2 FALSE 3 401276~ Valencia~ -#> 5 FALSE 101914902 2 FALSE 3 401276~ Morgan J~ -#> 6 TRUE 101915701 5 TRUE 3 401276~ Kourtney~ -#> 7 TRUE 101919001 5 FALSE 3 401276~ Dana Eva~ -#> 8 FALSE 101919002 5 FALSE 3 401276~ Kianna S~ -#> 9 TRUE 101919501 5 TRUE 5 401276~ Mykasa R~ -#> 10 TRUE 101924601 5 FALSE 5 401276~ Morgan J~ -#> # ... with 376 more rows, and 12 more variables: scoreValue <int>, -#> # period.displayValue <chr>, period.number <int>, coordinate.x <int>, -#> # coordinate.y <int>, clock.displayValue <chr>, team.id <chr>, type.id <chr>, -#> # type.text <chr>, play.id <chr>, athlete.id.1 <chr>, athlete.id.2 <chr>
    -
    +#> shooting_play sequence_number home_score scoring_play away_score id text +#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> +#> 1 FALSE 101899901 0 FALSE 0 40127~ Jump~ +#> 2 TRUE 101904901 2 TRUE 0 40127~ Morg~ +#> 3 TRUE 101907701 2 TRUE 3 40127~ Kian~ +#> 4 TRUE 101914901 2 FALSE 3 40127~ Vale~ +#> 5 FALSE 101914902 2 FALSE 3 40127~ Morg~ +#> 6 TRUE 101915701 5 TRUE 3 40127~ Kour~ +#> 7 TRUE 101919001 5 FALSE 3 40127~ Dana~ +#> 8 FALSE 101919002 5 FALSE 3 40127~ Kian~ +#> 9 TRUE 101919501 5 TRUE 5 40127~ Myka~ +#> 10 TRUE 101924601 5 FALSE 5 40127~ Morg~ +#> # ... with 376 more rows, and 12 more variables: score_value <int>, +#> # period_display_value <chr>, period_number <int>, coordinate_x <int>, +#> # coordinate_y <int>, clock_display_value <chr>, team_id <chr>, +#> # type_id <chr>, type_text <chr>, play_id <chr>, athlete_id_1 <chr>, +#> # athlete_id_2 <chr>
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -215,7 +221,7 @@

    Get ESPN women's college basketball player box

    Get ESPN women's college basketball player box

    -
    espn_wbb_player_box(game_id, verbose = FALSE)
    +
    espn_wbb_player_box(game_id)

    Arguments

    @@ -224,10 +230,6 @@

    Arg

    - - - -
    game_id

    Game ID

    verbose

    Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function

    Author

    @@ -235,69 +237,68 @@

    AuthorSaiem Gilani

    Examples

    -
    - espn_wbb_player_box(game_id = 401276115) -
    #> athlete.displayName team.shortDisplayName MIN FG 3PT FT OREB DREB REB -#> 1 Olivia Cochran Louisville 19 6-10 0-0 0-2 3 6 9 -#> 2 Hailey Van Lith Louisville 22 1-7 0-1 3-6 3 5 8 -#> 3 Mykasa Robinson Louisville 26 1-2 0-0 1-2 2 3 5 -#> 4 Kianna Smith Louisville 35 3-9 2-6 2-2 1 3 4 -#> 5 Dana Evans Louisville 38 5-21 1-9 2-2 1 1 2 -#> 6 Malea Williams Louisville 1 0-0 0-0 0-0 0 0 0 -#> 7 Elizabeth Dixon Louisville 24 3-5 0-0 2-4 1 4 5 -#> 8 Norika Konno Louisville 7 0-0 0-0 0-0 0 2 2 -#> 9 Ahlana Smith Louisville 2 0-0 0-0 0-0 0 0 0 -#> 10 Elizabeth Balogun Louisville 26 2-6 0-4 4-4 2 2 4 -#> 11 Valencia Myers Florida State 26 3-9 0-0 3-5 5 2 7 -#> 12 Sammie Puisis Florida State 29 0-5 0-4 0-0 1 2 3 -#> 13 Kourtney Weber Florida State 32 6-11 2-5 0-2 4 1 5 -#> 14 Bianca Jackson Florida State 27 1-8 0-0 5-6 0 2 2 -#> 15 Morgan Jones Florida State 29 7-13 0-0 12-15 3 7 10 -#> 16 Savannah Wilkinson Florida State 10 0-0 0-0 0-0 0 1 1 -#> 17 River Baldwin Florida State 14 1-3 0-0 1-2 2 3 5 -#> 18 Sayawni Lassiter Florida State 11 0-4 0-3 1-2 3 2 5 -#> 19 Tiana England Florida State 22 1-7 1-1 5-6 0 3 3 -#> AST STL BLK TO PF PTS starter ejected didNotPlay active athlete.jersey -#> 1 1 0 0 1 2 12 TRUE FALSE FALSE FALSE 44 -#> 2 2 2 0 1 4 5 TRUE FALSE FALSE FALSE 10 -#> 3 0 1 0 3 4 3 TRUE FALSE FALSE FALSE 5 -#> 4 3 0 0 1 4 10 TRUE FALSE FALSE FALSE 14 -#> 5 5 1 0 2 2 13 TRUE FALSE FALSE FALSE 1 -#> 6 0 0 0 0 1 0 FALSE FALSE FALSE FALSE 3 -#> 7 0 0 4 1 4 8 FALSE FALSE FALSE FALSE 22 -#> 8 0 0 0 1 2 0 FALSE FALSE FALSE FALSE 11 -#> 9 0 0 0 0 0 0 FALSE FALSE FALSE FALSE 2 -#> 10 2 1 0 1 3 8 FALSE FALSE FALSE FALSE 4 -#> 11 0 0 1 0 5 9 TRUE FALSE FALSE FALSE 32 -#> 12 2 1 0 0 2 0 TRUE FALSE FALSE FALSE 2 -#> 13 0 1 1 2 2 14 TRUE FALSE FALSE FALSE 10 -#> 14 1 0 0 2 2 7 TRUE FALSE FALSE FALSE 0 -#> 15 2 1 2 3 3 26 TRUE FALSE FALSE FALSE 24 -#> 16 0 1 0 1 1 0 FALSE FALSE FALSE FALSE 12 -#> 17 1 1 0 2 3 3 FALSE FALSE FALSE FALSE 1 -#> 18 1 1 0 0 1 1 FALSE FALSE FALSE FALSE 3 -#> 19 2 0 1 1 2 8 FALSE FALSE FALSE FALSE 23 -#> athlete.id athlete.shortName -#> 1 4433426 O. Cochran -#> 2 4433412 H. Van Lith -#> 3 4398604 M. Robinson -#> 4 4281919 K. Smith -#> 5 4281190 D. Evans -#> 6 4703211 M. Williams -#> 7 4594384 E. Dixon -#> 8 4433094 N. Konno -#> 9 4398835 A. Smith -#> 10 4398589 E. Balogun -#> 11 4398583 V. Myers -#> 12 4432862 S. Puisis -#> 13 4398582 K. Weber -#> 14 4280885 B. Jackson -#> 15 2984250 M. Jones -#> 16 4281175 S. Wilkinson -#> 17 4433304 R. Baldwin -#> 18 4281174 S. Lassiter -#> 19 4068155 T. England -#> athlete.headshot.href +
    espn_wbb_player_box(game_id = 401276115) +
    #> athlete_display_name team_short_display_name min fg fg3 ft oreb dreb +#> 1 Olivia Cochran Louisville 19 6-10 0-0 0-2 3 6 +#> 2 Hailey Van Lith Louisville 22 1-7 0-1 3-6 3 5 +#> 3 Mykasa Robinson Louisville 26 1-2 0-0 1-2 2 3 +#> 4 Kianna Smith Louisville 35 3-9 2-6 2-2 1 3 +#> 5 Dana Evans Louisville 38 5-21 1-9 2-2 1 1 +#> 6 Malea Williams Louisville 1 0-0 0-0 0-0 0 0 +#> 7 Elizabeth Dixon Louisville 24 3-5 0-0 2-4 1 4 +#> 8 Norika Konno Louisville 7 0-0 0-0 0-0 0 2 +#> 9 Ahlana Smith Louisville 2 0-0 0-0 0-0 0 0 +#> 10 Elizabeth Balogun Louisville 26 2-6 0-4 4-4 2 2 +#> 11 Valencia Myers Florida State 26 3-9 0-0 3-5 5 2 +#> 12 Sammie Puisis Florida State 29 0-5 0-4 0-0 1 2 +#> 13 Kourtney Weber Florida State 32 6-11 2-5 0-2 4 1 +#> 14 Bianca Jackson Florida State 27 1-8 0-0 5-6 0 2 +#> 15 Morgan Jones Florida State 29 7-13 0-0 12-15 3 7 +#> 16 Savannah Wilkinson Florida State 10 0-0 0-0 0-0 0 1 +#> 17 River Baldwin Florida State 14 1-3 0-0 1-2 2 3 +#> 18 Sayawni Lassiter Florida State 11 0-4 0-3 1-2 3 2 +#> 19 Tiana England Florida State 22 1-7 1-1 5-6 0 3 +#> reb ast stl blk to pf pts starter ejected did_not_play active athlete_jersey +#> 1 9 1 0 0 1 2 12 TRUE FALSE FALSE FALSE 44 +#> 2 8 2 2 0 1 4 5 TRUE FALSE FALSE FALSE 10 +#> 3 5 0 1 0 3 4 3 TRUE FALSE FALSE FALSE 5 +#> 4 4 3 0 0 1 4 10 TRUE FALSE FALSE FALSE 14 +#> 5 2 5 1 0 2 2 13 TRUE FALSE FALSE FALSE 1 +#> 6 0 0 0 0 0 1 0 FALSE FALSE FALSE FALSE 3 +#> 7 5 0 0 4 1 4 8 FALSE FALSE FALSE FALSE 22 +#> 8 2 0 0 0 1 2 0 FALSE FALSE FALSE FALSE 11 +#> 9 0 0 0 0 0 0 0 FALSE FALSE FALSE FALSE 2 +#> 10 4 2 1 0 1 3 8 FALSE FALSE FALSE FALSE 4 +#> 11 7 0 0 1 0 5 9 TRUE FALSE FALSE FALSE 32 +#> 12 3 2 1 0 0 2 0 TRUE FALSE FALSE FALSE 2 +#> 13 5 0 1 1 2 2 14 TRUE FALSE FALSE FALSE 10 +#> 14 2 1 0 0 2 2 7 TRUE FALSE FALSE FALSE 0 +#> 15 10 2 1 2 3 3 26 TRUE FALSE FALSE FALSE 24 +#> 16 1 0 1 0 1 1 0 FALSE FALSE FALSE FALSE 12 +#> 17 5 1 1 0 2 3 3 FALSE FALSE FALSE FALSE 1 +#> 18 5 1 1 0 0 1 1 FALSE FALSE FALSE FALSE 3 +#> 19 3 2 0 1 1 2 8 FALSE FALSE FALSE FALSE 23 +#> athlete_id athlete_short_name +#> 1 4433426 O. Cochran +#> 2 4433412 H. Van Lith +#> 3 4398604 M. Robinson +#> 4 4281919 K. Smith +#> 5 4281190 D. Evans +#> 6 4703211 M. Williams +#> 7 4594384 E. Dixon +#> 8 4433094 N. Konno +#> 9 4398835 A. Smith +#> 10 4398589 E. Balogun +#> 11 4398583 V. Myers +#> 12 4432862 S. Puisis +#> 13 4398582 K. Weber +#> 14 4280885 B. Jackson +#> 15 2984250 M. Jones +#> 16 4281175 S. Wilkinson +#> 17 4433304 R. Baldwin +#> 18 4281174 S. Lassiter +#> 19 4068155 T. England +#> athlete_headshot_href #> 1 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4433426.png #> 2 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4433412.png #> 3 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4398604.png @@ -317,7 +318,7 @@

    Examp #> 17 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4433304.png #> 18 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4281174.png #> 19 https://a.espncdn.com/i/headshots/womens-college-basketball/players/full/4068155.png -#> athlete.position.name athlete.position.abbreviation team.name +#> athlete_position_name athlete_position_abbreviation team_name #> 1 Forward F Cardinals #> 2 Guard G Cardinals #> 3 Guard G Cardinals @@ -337,7 +338,7 @@

    Examp #> 17 Center C Seminoles #> 18 Guard G Seminoles #> 19 Guard G Seminoles -#> team.logo team.id team.abbreviation +#> team_logo team_id team_abbreviation #> 1 https://a.espncdn.com/i/teamlogos/ncaa/500/97.png 97 LOU #> 2 https://a.espncdn.com/i/teamlogos/ncaa/500/97.png 97 LOU #> 3 https://a.espncdn.com/i/teamlogos/ncaa/500/97.png 97 LOU @@ -357,27 +358,26 @@

    Examp #> 17 https://a.espncdn.com/i/teamlogos/ncaa/500/52.png 52 FSU #> 18 https://a.espncdn.com/i/teamlogos/ncaa/500/52.png 52 FSU #> 19 https://a.espncdn.com/i/teamlogos/ncaa/500/52.png 52 FSU -#> team.color team.alternateColor -#> 1 ad000a cccccc -#> 2 ad000a cccccc -#> 3 ad000a cccccc -#> 4 ad000a cccccc -#> 5 ad000a cccccc -#> 6 ad000a cccccc -#> 7 ad000a cccccc -#> 8 ad000a cccccc -#> 9 ad000a cccccc -#> 10 ad000a cccccc -#> 11 782F40 ceb888 -#> 12 782F40 ceb888 -#> 13 782F40 ceb888 -#> 14 782F40 ceb888 -#> 15 782F40 ceb888 -#> 16 782F40 ceb888 -#> 17 782F40 ceb888 -#> 18 782F40 ceb888 -#> 19 782F40 ceb888

    -
    +#> team_color team_alternate_color +#> 1 ad000a cccccc +#> 2 ad000a cccccc +#> 3 ad000a cccccc +#> 4 ad000a cccccc +#> 5 ad000a cccccc +#> 6 ad000a cccccc +#> 7 ad000a cccccc +#> 8 ad000a cccccc +#> 9 ad000a cccccc +#> 10 ad000a cccccc +#> 11 782F40 ceb888 +#> 12 782F40 ceb888 +#> 13 782F40 ceb888 +#> 14 782F40 ceb888 +#> 15 782F40 ceb888 +#> 16 782F40 ceb888 +#> 17 782F40 ceb888 +#> 18 782F40 ceb888 +#> 19 782F40 ceb888
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -229,28 +235,28 @@

    Examp
    # Get current AP and Coaches Poll rankings espn_wbb_rankings()
    #> # A tibble: 45 x 36 -#> id name shortName type headline shortHeadline current previous points -#> <chr> <chr> <chr> <chr> <chr> <chr> <int> <int> <dbl> -#> 1 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 1 2 800 -#> 2 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 2 11 752 -#> 3 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 3 1 724 -#> 4 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 4 5 721 -#> 5 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 5 6 672 -#> 6 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 6 7 596 -#> 7 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 7 3 555 -#> 8 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 8 10 549 -#> 9 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 9 8 531 -#> 10 2 Coach~ Coaches ~ usa 2021 NCAA~ 2021 : Final~ 10 4 522 -#> # ... with 35 more rows, and 27 more variables: firstPlaceVotes <int>, -#> # trend <chr>, date <chr>, lastUpdated <chr>, recordSummary <chr>, -#> # team.id <chr>, team.uid <chr>, team.location <chr>, team.name <chr>, -#> # team.nickname <chr>, team.abbreviation <chr>, team.color <chr>, -#> # team.logo <chr>, occurrence.number <int>, occurrence.type <chr>, -#> # occurrence.last <lgl>, occurrence.value <chr>, -#> # occurrence.displayValue <chr>, season.year <int>, season.startDate <chr>, -#> # season.endDate <chr>, season.displayName <chr>, season.type.type <int>, -#> # season.type.name <chr>, season.type.abbreviation <chr>, -#> # firstOccurrence.type <chr>, firstOccurrence.value <chr>
    +#> id name short_name type headline short_headline current previous points +#> <chr> <chr> <chr> <chr> <chr> <chr> <int> <int> <dbl> +#> 1 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 1 2 800 +#> 2 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 2 11 752 +#> 3 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 3 1 724 +#> 4 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 4 5 721 +#> 5 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 5 6 672 +#> 6 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 6 7 596 +#> 7 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 7 3 555 +#> 8 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 8 10 549 +#> 9 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 9 8 531 +#> 10 2 Coach~ Coaches P~ usa 2021 NC~ 2021 : Final ~ 10 4 522 +#> # ... with 35 more rows, and 27 more variables: first_place_votes <int>, +#> # trend <chr>, date <chr>, last_updated <chr>, record_summary <chr>, +#> # team_id <chr>, team_uid <chr>, team_location <chr>, team_name <chr>, +#> # team_nickname <chr>, team_abbreviation <chr>, team_color <chr>, +#> # team_logo <chr>, occurrence_number <int>, occurrence_type <chr>, +#> # occurrence_last <lgl>, occurrence_value <chr>, +#> # occurrence_display_value <chr>, season_year <int>, season_start_date <chr>, +#> # season_end_date <chr>, season_display_name <chr>, season_type_type <int>, +#> # season_type_name <chr>, season_type_abbreviation <chr>, +#> # first_occurrence_type <chr>, first_occurrence_value <chr> @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -215,7 +221,7 @@

    Get women's college basketball schedule for a specific year from ESPN's API<

    Get women's college basketball schedule for a specific year from ESPN's API

    -
    espn_wbb_scoreboard(season, verbose = FALSE)
    +
    espn_wbb_scoreboard(season)

    Arguments

    @@ -224,10 +230,6 @@

    Arg

    - - - -
    season

    Either numeric or character

    verbose

    Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function

    Value

    @@ -239,7 +241,6 @@

    AuthorExamples

    # Get schedule returns 1000 results, max allowable. -# Must iterate through dates to get full year's schedule, as below: # Get schedule from date 2021-02-15, then next date and so on. espn_wbb_scoreboard (season = "20210215")
    #> # A tibble: 21 x 31 @@ -262,7 +263,7 @@

    Examp #> # away_team_name <chr>, away_team_logo <chr>, away_team_abb <chr>, #> # away_team_id <chr>, away_team_location <chr>, away_team_full <chr>, #> # away_team_color <chr>, away_score <int>, away_win <int>, away_record <chr>, -#> # status_name <chr>, startDate <chr>

    +#> # status_name <chr>, start_date <chr> @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -215,7 +221,7 @@

    Get ESPN women's college basketball team box data

    Get ESPN women's college basketball team box data

    -
    espn_wbb_team_box(game_id, verbose = FALSE)
    +
    espn_wbb_team_box(game_id)

    Arguments

    @@ -224,10 +230,6 @@

    Arg

    - - - -
    game_id

    Game ID

    verbose

    Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function

    Author

    @@ -235,11 +237,9 @@

    AuthorSaiem Gilani

    Examples

    -
    - - espn_wbb_team_box(game_id = 401276115) +
    espn_wbb_team_box(game_id = 401276115)
    #> # A tibble: 22 x 3 -#> Home label Away +#> home label away #> <chr> <chr> <chr> #> 1 Florida State Team Louisville #> 2 19-60 FG 21-60 @@ -251,8 +251,7 @@

    Examp #> 8 45 Rebounds 41 #> 9 19 Offensive Rebounds 14 #> 10 26 Defensive Rebounds 27 -#> # ... with 12 more rows

    -
    +#> # ... with 12 more rows
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -223,30 +229,22 @@

    AuthorSaiem Gilani

    Examples

    -
    - espn_wbb_teams() -
    #> # A tibble: 352 x 34 -#> id uid slug location name nickname abbreviation displayName -#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> -#> 1 2000 s:40~l~ abilene-~ Abilene C~ Wildc~ Abil Ch~ ACU Abilene Chri~ -#> 2 2005 s:40~l~ air-forc~ Air Force Falco~ Air For~ AFA Air Force Fa~ -#> 3 2006 s:40~l~ akron-zi~ Akron Zips Akron AKR Akron Zips -#> 4 2010 s:40~l~ alabama-~ Alabama A~ Bulld~ Alabama~ AAMU Alabama A&M ~ -#> 5 333 s:40~l~ alabama-~ Alabama Crims~ Alabama ALA Alabama Crim~ -#> 6 2011 s:40~l~ alabama-~ Alabama St Lady ~ Alabama~ ALST Alabama St L~ -#> 7 399 s:40~l~ albany-g~ Albany Great~ Albany ALB Albany Great~ -#> 8 2016 s:40~l~ alcorn-s~ Alcorn St~ Lady ~ Alcorn ~ ALCN Alcorn State~ -#> 9 44 s:40~l~ american~ American Eagles American AMER American Eag~ -#> 10 2026 s:40~l~ appalach~ Appalachi~ Mount~ Appalac~ APP Appalachian ~ -#> # ... with 342 more rows, and 26 more variables: shortDisplayName <chr>, -#> # color <chr>, alternateColor <chr>, isActive <lgl>, isAllStar <lgl>, -#> # logos_href_1 <chr>, logos_href_2 <chr>, summary <chr>, playoffSeed <dbl>, -#> # wins <dbl>, losses <dbl>, winPercent <dbl>, gamesBehind <dbl>, ties <dbl>, -#> # OTWins <dbl>, OTLosses <dbl>, gamesPlayed <dbl>, pointsFor <dbl>, -#> # pointsAgainst <dbl>, avgPointsFor <dbl>, avgPointsAgainst <dbl>, -#> # points <dbl>, differential <dbl>, streak <dbl>, divisionWinPercent <dbl>, -#> # leagueWinPercent <dbl>
    -
    +
    espn_wbb_teams() +
    #> # A tibble: 352 x 11 +#> team_id team mascot nickname abbreviation display_name short_name color +#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> +#> 1 2000 Abilen~ Wildca~ Abil Chr~ ACU Abilene Chri~ Abil Chri~ 4e26~ +#> 2 2005 Air Fo~ Falcons Air Force AFA Air Force Fa~ Air Force 004a~ +#> 3 2006 Akron Zips Akron AKR Akron Zips Akron 0028~ +#> 4 2010 Alabam~ Bulldo~ Alabama ~ AAMU Alabama A&M ~ Alabama A~ 7900~ +#> 5 333 Alabama Crimso~ Alabama ALA Alabama Crim~ Alabama 6900~ +#> 6 2011 Alabam~ Lady H~ Alabama ~ ALST Alabama St L~ Alabama S~ e9a9~ +#> 7 399 Albany Great ~ Albany ALB Albany Great~ Albany 3D27~ +#> 8 2016 Alcorn~ Lady B~ Alcorn S~ ALCN Alcorn State~ Alcorn St~ 4b00~ +#> 9 44 Americ~ Eagles American AMER American Eag~ American c411~ +#> 10 2026 Appala~ Mounta~ Appalach~ APP Appalachian ~ Appalachi~ 0000~ +#> # ... with 342 more rows, and 3 more variables: alternate_color <chr>, +#> # logo <chr>, logo_dark <chr>
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -231,31 +237,30 @@

    AuthorSaiem Gilani

    Examples

    -
    -espn_wnba_game_all(game_id = 401244185) +
    espn_wnba_game_all(game_id = 401244185)
    #> $Plays #> # A tibble: 388 x 20 -#> shootingPlay sequenceNumber homeScore scoringPlay awayScore id text -#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> -#> 1 FALSE 4 0 FALSE 0 40124~ Carolyn S~ -#> 2 FALSE 7 0 FALSE 0 40124~ Natasha H~ -#> 3 FALSE 9 0 FALSE 0 40124~ Natasha H~ -#> 4 TRUE 10 0 FALSE 0 40124~ Danielle ~ -#> 5 FALSE 11 0 FALSE 0 40124~ Carolyn S~ -#> 6 TRUE 12 0 TRUE 2 40124~ Carolyn S~ -#> 7 TRUE 13 0 FALSE 2 40124~ Sue Bird ~ -#> 8 FALSE 14 0 FALSE 2 40124~ Las Vegas~ -#> 9 TRUE 15 0 TRUE 4 40124~ A'ja Wils~ -#> 10 FALSE 17 0 FALSE 4 40124~ Angel McC~ -#> # ... with 378 more rows, and 13 more variables: scoreValue <int>, -#> # period.displayValue <chr>, period.number <int>, coordinate.x <int>, -#> # coordinate.y <int>, clock.displayValue <chr>, team.id <chr>, type.id <chr>, -#> # type.text <chr>, play.id <chr>, athlete.id.1 <chr>, athlete.id.2 <chr>, -#> # athlete.id.3 <chr> +#> shooting_play sequence_number home_score scoring_play away_score id text +#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> +#> 1 FALSE 4 0 FALSE 0 40124~ Caro~ +#> 2 FALSE 7 0 FALSE 0 40124~ Nata~ +#> 3 FALSE 9 0 FALSE 0 40124~ Nata~ +#> 4 TRUE 10 0 FALSE 0 40124~ Dani~ +#> 5 FALSE 11 0 FALSE 0 40124~ Caro~ +#> 6 TRUE 12 0 TRUE 2 40124~ Caro~ +#> 7 TRUE 13 0 FALSE 2 40124~ Sue ~ +#> 8 FALSE 14 0 FALSE 2 40124~ Las ~ +#> 9 TRUE 15 0 TRUE 4 40124~ A'ja~ +#> 10 FALSE 17 0 FALSE 4 40124~ Ange~ +#> # ... with 378 more rows, and 13 more variables: score_value <int>, +#> # period_display_value <chr>, period_number <int>, coordinate_x <int>, +#> # coordinate_y <int>, clock_display_value <chr>, team_id <chr>, +#> # type_id <chr>, type_text <chr>, play_id <chr>, athlete_id_1 <chr>, +#> # athlete_id_2 <chr>, athlete_id_3 <chr> #> #> $Team #> # A tibble: 21 x 3 -#> Home label Away +#> home label away #> <chr> <chr> <chr> #> 1 Storm Team Aces #> 2 38-80 FG 22-64 @@ -270,75 +275,75 @@

    Examp #> # ... with 11 more rows #> #> $Player -#> athlete.displayName team.shortDisplayName MIN FG 3PT FT OREB DREB REB -#> 1 Angel McCoughtry Aces 20 2-7 1-1 2-2 0 1 1 -#> 2 Carolyn Swords Aces 25 3-5 0-0 0-0 4 6 10 -#> 3 A'ja Wilson Aces 32 7-15 0-0 4-4 0 6 6 -#> 4 Danielle Robinson Aces 25 2-7 0-0 0-2 0 2 2 -#> 5 Kayla McBride Aces 25 3-7 1-2 2-2 0 6 6 -#> 6 Emma Cannon Aces 17 1-4 0-0 0-2 2 1 3 -#> 7 Cierra Burdick Aces 9 0-2 0-0 0-0 0 1 1 -#> 8 Sugar Rodgers Aces 15 0-3 0-2 0-0 1 1 2 -#> 9 Lindsay Allen Aces 7 1-2 0-0 0-0 0 1 1 -#> 10 Jackie Young Aces 26 3-12 0-0 5-6 0 1 1 -#> 11 Alysha Clark Storm 30 3-8 2-4 2-2 3 4 7 -#> 12 Natasha Howard Storm 17 2-4 0-0 1-2 2 5 7 -#> 13 Breanna Stewart Storm 25 10-14 3-4 3-4 0 4 4 -#> 14 Sue Bird Storm 22 2-6 1-4 0-0 0 1 1 -#> 15 Jewell Loyd Storm 30 9-18 1-5 0-0 2 7 9 -#> 16 Crystal Langhorne Storm 6 0-2 0-2 0-0 0 2 2 -#> 17 Morgan Tuck Storm 7 1-5 0-2 0-0 0 1 1 -#> 18 Mercedes Russell Storm 25 3-5 0-0 0-0 2 3 5 -#> 19 Ezi Magbegor Storm 7 0-2 0-1 2-2 0 1 1 -#> 20 Epiphanny Prince Storm 13 1-4 0-3 0-0 0 0 0 -#> 21 Jordin Canada Storm 18 7-12 0-1 1-2 2 3 5 -#> AST STL BLK TO PF +/- PTS starter ejected didNotPlay active athlete.jersey -#> 1 1 1 0 0 4 -10 7 TRUE FALSE FALSE FALSE 35 -#> 2 2 0 0 1 0 -16 6 TRUE FALSE FALSE FALSE 4 -#> 3 4 1 1 1 3 -23 18 TRUE FALSE FALSE FALSE 22 -#> 4 3 1 0 1 1 -21 4 TRUE FALSE FALSE FALSE 3 -#> 5 2 2 0 2 2 -17 9 TRUE FALSE FALSE FALSE <NA> -#> 6 0 0 0 4 4 -21 2 FALSE FALSE FALSE TRUE 32 -#> 7 0 0 0 0 0 -8 0 FALSE FALSE FALSE TRUE 11 -#> 8 1 0 0 1 1 -15 0 FALSE FALSE FALSE TRUE 14 -#> 9 0 0 1 5 2 -6 2 FALSE FALSE FALSE TRUE 15 -#> 10 1 0 0 3 4 -28 11 FALSE FALSE FALSE TRUE 0 -#> 11 5 1 0 0 3 +27 10 TRUE FALSE FALSE FALSE 32 -#> 12 1 3 0 1 2 +8 5 TRUE FALSE FALSE FALSE 6 -#> 13 0 1 0 0 3 +14 26 TRUE FALSE FALSE FALSE 30 -#> 14 7 0 2 1 3 +12 5 TRUE FALSE FALSE FALSE 10 -#> 15 4 2 0 2 1 +23 19 TRUE FALSE FALSE FALSE 24 -#> 16 1 0 0 0 1 +4 0 FALSE FALSE FALSE TRUE 1 -#> 17 1 0 0 0 1 +6 2 FALSE FALSE FALSE TRUE 3 -#> 18 2 0 0 1 3 +32 6 FALSE FALSE FALSE FALSE 2 -#> 19 1 0 0 0 0 +8 2 FALSE FALSE FALSE TRUE 13 -#> 20 1 0 0 0 0 +10 2 FALSE FALSE FALSE TRUE 11 -#> 21 3 1 0 1 1 +21 15 FALSE FALSE FALSE TRUE 21 -#> athlete.id athlete.shortName athlete.position.name -#> 1 872 A. McCoughtry Forward -#> 2 982 C. Swords Center -#> 3 3149391 A. Wilson Center -#> 4 1014 D. Robinson Guard -#> 5 2529205 K. McBride Guard -#> 6 2284331 E. Cannon Forward -#> 7 2566452 C. Burdick Forward -#> 8 2491197 S. Rodgers Guard -#> 9 3058908 L. Allen Guard -#> 10 4065870 J. Young Guard -#> 11 924 A. Clark Forward -#> 12 2529130 N. Howard Forward -#> 13 2998928 B. Stewart Forward -#> 14 91 S. Bird Guard -#> 15 2987869 J. Loyd Guard -#> 16 805 C. Langhorne Forward -#> 17 2998929 M. Tuck Forward -#> 18 3056672 M. Russell Center -#> 19 4420318 E. Magbegor Center -#> 20 882 E. Prince Guard -#> 21 3142250 J. Canada Guard -#> athlete.position.abbreviation team.name +#> athlete_display_name team_short_display_name min fg fg3 ft oreb dreb reb +#> 1 Angel McCoughtry Aces 20 2-7 1-1 2-2 0 1 1 +#> 2 A'ja Wilson Aces 32 7-15 0-0 4-4 0 6 6 +#> 3 Carolyn Swords Aces 25 3-5 0-0 0-0 4 6 10 +#> 4 Danielle Robinson Aces 25 2-7 0-0 0-2 0 2 2 +#> 5 Kayla McBride Aces 25 3-7 1-2 2-2 0 6 6 +#> 6 Emma Cannon Aces 17 1-4 0-0 0-2 2 1 3 +#> 7 Cierra Burdick Aces 9 0-2 0-0 0-0 0 1 1 +#> 8 Sugar Rodgers Aces 15 0-3 0-2 0-0 1 1 2 +#> 9 Lindsay Allen Aces 7 1-2 0-0 0-0 0 1 1 +#> 10 Jackie Young Aces 26 3-12 0-0 5-6 0 1 1 +#> 11 Alysha Clark Storm 30 3-8 2-4 2-2 3 4 7 +#> 12 Natasha Howard Storm 17 2-4 0-0 1-2 2 5 7 +#> 13 Breanna Stewart Storm 25 10-14 3-4 3-4 0 4 4 +#> 14 Sue Bird Storm 22 2-6 1-4 0-0 0 1 1 +#> 15 Jewell Loyd Storm 30 9-18 1-5 0-0 2 7 9 +#> 16 Crystal Langhorne Storm 6 0-2 0-2 0-0 0 2 2 +#> 17 Morgan Tuck Storm 7 1-5 0-2 0-0 0 1 1 +#> 18 Mercedes Russell Storm 25 3-5 0-0 0-0 2 3 5 +#> 19 Ezi Magbegor Storm 7 0-2 0-1 2-2 0 1 1 +#> 20 Epiphanny Prince Storm 13 1-4 0-3 0-0 0 0 0 +#> 21 Jordin Canada Storm 18 7-12 0-1 1-2 2 3 5 +#> ast stl blk to pf +/- pts starter ejected did_not_play active athlete_jersey +#> 1 1 1 0 0 4 -10 7 TRUE FALSE FALSE FALSE 35 +#> 2 4 1 1 1 3 -23 18 TRUE FALSE FALSE FALSE 22 +#> 3 2 0 0 1 0 -16 6 TRUE FALSE FALSE FALSE 4 +#> 4 3 1 0 1 1 -21 4 TRUE FALSE FALSE FALSE 3 +#> 5 2 2 0 2 2 -17 9 TRUE FALSE FALSE FALSE 21 +#> 6 0 0 0 4 4 -21 2 FALSE FALSE FALSE TRUE 32 +#> 7 0 0 0 0 0 -8 0 FALSE FALSE FALSE TRUE 33 +#> 8 1 0 0 1 1 -15 0 FALSE FALSE FALSE TRUE 14 +#> 9 0 0 1 5 2 -6 2 FALSE FALSE FALSE TRUE 12 +#> 10 1 0 0 3 4 -28 11 FALSE FALSE FALSE TRUE 0 +#> 11 5 1 0 0 3 +27 10 TRUE FALSE FALSE FALSE <NA> +#> 12 1 3 0 1 2 +8 5 TRUE FALSE FALSE FALSE 6 +#> 13 0 1 0 0 3 +14 26 TRUE FALSE FALSE FALSE 30 +#> 14 7 0 2 1 3 +12 5 TRUE FALSE FALSE FALSE 10 +#> 15 4 2 0 2 1 +23 19 TRUE FALSE FALSE FALSE 24 +#> 16 1 0 0 0 1 +4 0 FALSE FALSE FALSE TRUE 1 +#> 17 1 0 0 0 1 +6 2 FALSE FALSE FALSE TRUE 3 +#> 18 2 0 0 1 3 +32 6 FALSE FALSE FALSE FALSE 2 +#> 19 1 0 0 0 0 +8 2 FALSE FALSE FALSE TRUE 13 +#> 20 1 0 0 0 0 +10 2 FALSE FALSE FALSE TRUE 11 +#> 21 3 1 0 1 1 +21 15 FALSE FALSE FALSE TRUE 21 +#> athlete_id athlete_short_name athlete_position_name +#> 1 872 A. McCoughtry Forward +#> 2 3149391 A. Wilson Forward +#> 3 982 C. Swords Center +#> 4 1014 D. Robinson Guard +#> 5 2529205 K. McBride Guard +#> 6 2284331 E. Cannon Forward +#> 7 2566452 C. Burdick Forward +#> 8 2491197 S. Rodgers Guard +#> 9 3058908 L. Allen Guard +#> 10 4065870 J. Young Guard +#> 11 924 A. Clark Forward +#> 12 2529130 N. Howard Forward +#> 13 2998928 B. Stewart Forward +#> 14 91 S. Bird Guard +#> 15 2987869 J. Loyd Guard +#> 16 805 C. Langhorne Forward +#> 17 2998929 M. Tuck Forward +#> 18 3056672 M. Russell Center +#> 19 4420318 E. Magbegor Center +#> 20 882 E. Prince Guard +#> 21 3142250 J. Canada Guard +#> athlete_position_abbreviation team_name #> 1 F Aces -#> 2 C Aces +#> 2 F Aces #> 3 C Aces #> 4 G Aces #> 5 G Aces @@ -358,7 +363,7 @@

    Examp #> 19 C Storm #> 20 G Storm #> 21 G Storm -#> team.logo team.id team.abbreviation +#> team_logo team_id team_abbreviation #> 1 https://a.espncdn.com/i/teamlogos/wnba/500/lv.png 17 LV #> 2 https://a.espncdn.com/i/teamlogos/wnba/500/lv.png 17 LV #> 3 https://a.espncdn.com/i/teamlogos/wnba/500/lv.png 17 LV @@ -380,30 +385,29 @@

    Examp #> 19 https://a.espncdn.com/i/teamlogos/wnba/500/sea.png 14 SEA #> 20 https://a.espncdn.com/i/teamlogos/wnba/500/sea.png 14 SEA #> 21 https://a.espncdn.com/i/teamlogos/wnba/500/sea.png 14 SEA -#> team.color team.alternateColor -#> 1 000000 c7cfd4 -#> 2 000000 c7cfd4 -#> 3 000000 c7cfd4 -#> 4 000000 c7cfd4 -#> 5 000000 c7cfd4 -#> 6 000000 c7cfd4 -#> 7 000000 c7cfd4 -#> 8 000000 c7cfd4 -#> 9 000000 c7cfd4 -#> 10 000000 c7cfd4 -#> 11 05452a f7c43c -#> 12 05452a f7c43c -#> 13 05452a f7c43c -#> 14 05452a f7c43c -#> 15 05452a f7c43c -#> 16 05452a f7c43c -#> 17 05452a f7c43c -#> 18 05452a f7c43c -#> 19 05452a f7c43c -#> 20 05452a f7c43c -#> 21 05452a f7c43c -#>

    -
    +#> team_color team_alternate_color +#> 1 000000 c7cfd4 +#> 2 000000 c7cfd4 +#> 3 000000 c7cfd4 +#> 4 000000 c7cfd4 +#> 5 000000 c7cfd4 +#> 6 000000 c7cfd4 +#> 7 000000 c7cfd4 +#> 8 000000 c7cfd4 +#> 9 000000 c7cfd4 +#> 10 000000 c7cfd4 +#> 11 05452a f7c43c +#> 12 05452a f7c43c +#> 13 05452a f7c43c +#> 14 05452a f7c43c +#> 15 05452a f7c43c +#> 16 05452a f7c43c +#> 17 05452a f7c43c +#> 18 05452a f7c43c +#> 19 05452a f7c43c +#> 20 05452a f7c43c +#> 21 05452a f7c43c +#>
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -231,27 +237,25 @@

    AuthorSaiem Gilani

    Examples

    -
    - espn_wnba_pbp(game_id = 401244185) +
    espn_wnba_pbp(game_id = 401244185)
    #> # A tibble: 388 x 20 -#> shootingPlay sequenceNumber homeScore scoringPlay awayScore id text -#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> -#> 1 FALSE 4 0 FALSE 0 40124~ Carolyn S~ -#> 2 FALSE 7 0 FALSE 0 40124~ Natasha H~ -#> 3 FALSE 9 0 FALSE 0 40124~ Natasha H~ -#> 4 TRUE 10 0 FALSE 0 40124~ Danielle ~ -#> 5 FALSE 11 0 FALSE 0 40124~ Carolyn S~ -#> 6 TRUE 12 0 TRUE 2 40124~ Carolyn S~ -#> 7 TRUE 13 0 FALSE 2 40124~ Sue Bird ~ -#> 8 FALSE 14 0 FALSE 2 40124~ Las Vegas~ -#> 9 TRUE 15 0 TRUE 4 40124~ A'ja Wils~ -#> 10 FALSE 17 0 FALSE 4 40124~ Angel McC~ -#> # ... with 378 more rows, and 13 more variables: scoreValue <int>, -#> # period.displayValue <chr>, period.number <int>, coordinate.x <int>, -#> # coordinate.y <int>, clock.displayValue <chr>, team.id <chr>, type.id <chr>, -#> # type.text <chr>, play.id <chr>, athlete.id.1 <chr>, athlete.id.2 <chr>, -#> # athlete.id.3 <chr>
    -
    +#> shooting_play sequence_number home_score scoring_play away_score id text +#> <lgl> <chr> <int> <lgl> <int> <chr> <chr> +#> 1 FALSE 4 0 FALSE 0 40124~ Caro~ +#> 2 FALSE 7 0 FALSE 0 40124~ Nata~ +#> 3 FALSE 9 0 FALSE 0 40124~ Nata~ +#> 4 TRUE 10 0 FALSE 0 40124~ Dani~ +#> 5 FALSE 11 0 FALSE 0 40124~ Caro~ +#> 6 TRUE 12 0 TRUE 2 40124~ Caro~ +#> 7 TRUE 13 0 FALSE 2 40124~ Sue ~ +#> 8 FALSE 14 0 FALSE 2 40124~ Las ~ +#> 9 TRUE 15 0 TRUE 4 40124~ A'ja~ +#> 10 FALSE 17 0 FALSE 4 40124~ Ange~ +#> # ... with 378 more rows, and 13 more variables: score_value <int>, +#> # period_display_value <chr>, period_number <int>, coordinate_x <int>, +#> # coordinate_y <int>, clock_display_value <chr>, team_id <chr>, +#> # type_id <chr>, type_text <chr>, play_id <chr>, athlete_id_1 <chr>, +#> # athlete_id_2 <chr>, athlete_id_3 <chr>
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -231,77 +237,76 @@

    AuthorSaiem Gilani

    Examples

    -
    - espn_wnba_player_box(game_id = 401244185) -
    #> athlete.displayName team.shortDisplayName MIN FG 3PT FT OREB DREB REB -#> 1 Angel McCoughtry Aces 20 2-7 1-1 2-2 0 1 1 -#> 2 Carolyn Swords Aces 25 3-5 0-0 0-0 4 6 10 -#> 3 A'ja Wilson Aces 32 7-15 0-0 4-4 0 6 6 -#> 4 Danielle Robinson Aces 25 2-7 0-0 0-2 0 2 2 -#> 5 Kayla McBride Aces 25 3-7 1-2 2-2 0 6 6 -#> 6 Emma Cannon Aces 17 1-4 0-0 0-2 2 1 3 -#> 7 Cierra Burdick Aces 9 0-2 0-0 0-0 0 1 1 -#> 8 Sugar Rodgers Aces 15 0-3 0-2 0-0 1 1 2 -#> 9 Lindsay Allen Aces 7 1-2 0-0 0-0 0 1 1 -#> 10 Jackie Young Aces 26 3-12 0-0 5-6 0 1 1 -#> 11 Alysha Clark Storm 30 3-8 2-4 2-2 3 4 7 -#> 12 Natasha Howard Storm 17 2-4 0-0 1-2 2 5 7 -#> 13 Breanna Stewart Storm 25 10-14 3-4 3-4 0 4 4 -#> 14 Sue Bird Storm 22 2-6 1-4 0-0 0 1 1 -#> 15 Jewell Loyd Storm 30 9-18 1-5 0-0 2 7 9 -#> 16 Crystal Langhorne Storm 6 0-2 0-2 0-0 0 2 2 -#> 17 Morgan Tuck Storm 7 1-5 0-2 0-0 0 1 1 -#> 18 Mercedes Russell Storm 25 3-5 0-0 0-0 2 3 5 -#> 19 Ezi Magbegor Storm 7 0-2 0-1 2-2 0 1 1 -#> 20 Epiphanny Prince Storm 13 1-4 0-3 0-0 0 0 0 -#> 21 Jordin Canada Storm 18 7-12 0-1 1-2 2 3 5 -#> AST STL BLK TO PF +/- PTS starter ejected didNotPlay active athlete.jersey -#> 1 1 1 0 0 4 -10 7 TRUE FALSE FALSE FALSE 35 -#> 2 2 0 0 1 0 -16 6 TRUE FALSE FALSE FALSE 4 -#> 3 4 1 1 1 3 -23 18 TRUE FALSE FALSE FALSE 22 -#> 4 3 1 0 1 1 -21 4 TRUE FALSE FALSE FALSE 3 -#> 5 2 2 0 2 2 -17 9 TRUE FALSE FALSE FALSE <NA> -#> 6 0 0 0 4 4 -21 2 FALSE FALSE FALSE TRUE 32 -#> 7 0 0 0 0 0 -8 0 FALSE FALSE FALSE TRUE 11 -#> 8 1 0 0 1 1 -15 0 FALSE FALSE FALSE TRUE 14 -#> 9 0 0 1 5 2 -6 2 FALSE FALSE FALSE TRUE 15 -#> 10 1 0 0 3 4 -28 11 FALSE FALSE FALSE TRUE 0 -#> 11 5 1 0 0 3 +27 10 TRUE FALSE FALSE FALSE 32 -#> 12 1 3 0 1 2 +8 5 TRUE FALSE FALSE FALSE 6 -#> 13 0 1 0 0 3 +14 26 TRUE FALSE FALSE FALSE 30 -#> 14 7 0 2 1 3 +12 5 TRUE FALSE FALSE FALSE 10 -#> 15 4 2 0 2 1 +23 19 TRUE FALSE FALSE FALSE 24 -#> 16 1 0 0 0 1 +4 0 FALSE FALSE FALSE TRUE 1 -#> 17 1 0 0 0 1 +6 2 FALSE FALSE FALSE TRUE 3 -#> 18 2 0 0 1 3 +32 6 FALSE FALSE FALSE FALSE 2 -#> 19 1 0 0 0 0 +8 2 FALSE FALSE FALSE TRUE 13 -#> 20 1 0 0 0 0 +10 2 FALSE FALSE FALSE TRUE 11 -#> 21 3 1 0 1 1 +21 15 FALSE FALSE FALSE TRUE 21 -#> athlete.id athlete.shortName athlete.position.name -#> 1 872 A. McCoughtry Forward -#> 2 982 C. Swords Center -#> 3 3149391 A. Wilson Center -#> 4 1014 D. Robinson Guard -#> 5 2529205 K. McBride Guard -#> 6 2284331 E. Cannon Forward -#> 7 2566452 C. Burdick Forward -#> 8 2491197 S. Rodgers Guard -#> 9 3058908 L. Allen Guard -#> 10 4065870 J. Young Guard -#> 11 924 A. Clark Forward -#> 12 2529130 N. Howard Forward -#> 13 2998928 B. Stewart Forward -#> 14 91 S. Bird Guard -#> 15 2987869 J. Loyd Guard -#> 16 805 C. Langhorne Forward -#> 17 2998929 M. Tuck Forward -#> 18 3056672 M. Russell Center -#> 19 4420318 E. Magbegor Center -#> 20 882 E. Prince Guard -#> 21 3142250 J. Canada Guard -#> athlete.position.abbreviation team.name +
    espn_wnba_player_box(game_id = 401244185) +
    #> athlete_display_name team_short_display_name min fg fg3 ft oreb dreb reb +#> 1 Angel McCoughtry Aces 20 2-7 1-1 2-2 0 1 1 +#> 2 A'ja Wilson Aces 32 7-15 0-0 4-4 0 6 6 +#> 3 Carolyn Swords Aces 25 3-5 0-0 0-0 4 6 10 +#> 4 Danielle Robinson Aces 25 2-7 0-0 0-2 0 2 2 +#> 5 Kayla McBride Aces 25 3-7 1-2 2-2 0 6 6 +#> 6 Emma Cannon Aces 17 1-4 0-0 0-2 2 1 3 +#> 7 Cierra Burdick Aces 9 0-2 0-0 0-0 0 1 1 +#> 8 Sugar Rodgers Aces 15 0-3 0-2 0-0 1 1 2 +#> 9 Lindsay Allen Aces 7 1-2 0-0 0-0 0 1 1 +#> 10 Jackie Young Aces 26 3-12 0-0 5-6 0 1 1 +#> 11 Alysha Clark Storm 30 3-8 2-4 2-2 3 4 7 +#> 12 Natasha Howard Storm 17 2-4 0-0 1-2 2 5 7 +#> 13 Breanna Stewart Storm 25 10-14 3-4 3-4 0 4 4 +#> 14 Sue Bird Storm 22 2-6 1-4 0-0 0 1 1 +#> 15 Jewell Loyd Storm 30 9-18 1-5 0-0 2 7 9 +#> 16 Crystal Langhorne Storm 6 0-2 0-2 0-0 0 2 2 +#> 17 Morgan Tuck Storm 7 1-5 0-2 0-0 0 1 1 +#> 18 Mercedes Russell Storm 25 3-5 0-0 0-0 2 3 5 +#> 19 Ezi Magbegor Storm 7 0-2 0-1 2-2 0 1 1 +#> 20 Epiphanny Prince Storm 13 1-4 0-3 0-0 0 0 0 +#> 21 Jordin Canada Storm 18 7-12 0-1 1-2 2 3 5 +#> ast stl blk to pf +/- pts starter ejected did_not_play active athlete_jersey +#> 1 1 1 0 0 4 -10 7 TRUE FALSE FALSE FALSE 35 +#> 2 4 1 1 1 3 -23 18 TRUE FALSE FALSE FALSE 22 +#> 3 2 0 0 1 0 -16 6 TRUE FALSE FALSE FALSE 4 +#> 4 3 1 0 1 1 -21 4 TRUE FALSE FALSE FALSE 3 +#> 5 2 2 0 2 2 -17 9 TRUE FALSE FALSE FALSE 21 +#> 6 0 0 0 4 4 -21 2 FALSE FALSE FALSE TRUE 32 +#> 7 0 0 0 0 0 -8 0 FALSE FALSE FALSE TRUE 33 +#> 8 1 0 0 1 1 -15 0 FALSE FALSE FALSE TRUE 14 +#> 9 0 0 1 5 2 -6 2 FALSE FALSE FALSE TRUE 12 +#> 10 1 0 0 3 4 -28 11 FALSE FALSE FALSE TRUE 0 +#> 11 5 1 0 0 3 +27 10 TRUE FALSE FALSE FALSE <NA> +#> 12 1 3 0 1 2 +8 5 TRUE FALSE FALSE FALSE 6 +#> 13 0 1 0 0 3 +14 26 TRUE FALSE FALSE FALSE 30 +#> 14 7 0 2 1 3 +12 5 TRUE FALSE FALSE FALSE 10 +#> 15 4 2 0 2 1 +23 19 TRUE FALSE FALSE FALSE 24 +#> 16 1 0 0 0 1 +4 0 FALSE FALSE FALSE TRUE 1 +#> 17 1 0 0 0 1 +6 2 FALSE FALSE FALSE TRUE 3 +#> 18 2 0 0 1 3 +32 6 FALSE FALSE FALSE FALSE 2 +#> 19 1 0 0 0 0 +8 2 FALSE FALSE FALSE TRUE 13 +#> 20 1 0 0 0 0 +10 2 FALSE FALSE FALSE TRUE 11 +#> 21 3 1 0 1 1 +21 15 FALSE FALSE FALSE TRUE 21 +#> athlete_id athlete_short_name athlete_position_name +#> 1 872 A. McCoughtry Forward +#> 2 3149391 A. Wilson Forward +#> 3 982 C. Swords Center +#> 4 1014 D. Robinson Guard +#> 5 2529205 K. McBride Guard +#> 6 2284331 E. Cannon Forward +#> 7 2566452 C. Burdick Forward +#> 8 2491197 S. Rodgers Guard +#> 9 3058908 L. Allen Guard +#> 10 4065870 J. Young Guard +#> 11 924 A. Clark Forward +#> 12 2529130 N. Howard Forward +#> 13 2998928 B. Stewart Forward +#> 14 91 S. Bird Guard +#> 15 2987869 J. Loyd Guard +#> 16 805 C. Langhorne Forward +#> 17 2998929 M. Tuck Forward +#> 18 3056672 M. Russell Center +#> 19 4420318 E. Magbegor Center +#> 20 882 E. Prince Guard +#> 21 3142250 J. Canada Guard +#> athlete_position_abbreviation team_name #> 1 F Aces -#> 2 C Aces +#> 2 F Aces #> 3 C Aces #> 4 G Aces #> 5 G Aces @@ -321,7 +326,7 @@

    Examp #> 19 C Storm #> 20 G Storm #> 21 G Storm -#> team.logo team.id team.abbreviation +#> team_logo team_id team_abbreviation #> 1 https://a.espncdn.com/i/teamlogos/wnba/500/lv.png 17 LV #> 2 https://a.espncdn.com/i/teamlogos/wnba/500/lv.png 17 LV #> 3 https://a.espncdn.com/i/teamlogos/wnba/500/lv.png 17 LV @@ -343,29 +348,28 @@

    Examp #> 19 https://a.espncdn.com/i/teamlogos/wnba/500/sea.png 14 SEA #> 20 https://a.espncdn.com/i/teamlogos/wnba/500/sea.png 14 SEA #> 21 https://a.espncdn.com/i/teamlogos/wnba/500/sea.png 14 SEA -#> team.color team.alternateColor -#> 1 000000 c7cfd4 -#> 2 000000 c7cfd4 -#> 3 000000 c7cfd4 -#> 4 000000 c7cfd4 -#> 5 000000 c7cfd4 -#> 6 000000 c7cfd4 -#> 7 000000 c7cfd4 -#> 8 000000 c7cfd4 -#> 9 000000 c7cfd4 -#> 10 000000 c7cfd4 -#> 11 05452a f7c43c -#> 12 05452a f7c43c -#> 13 05452a f7c43c -#> 14 05452a f7c43c -#> 15 05452a f7c43c -#> 16 05452a f7c43c -#> 17 05452a f7c43c -#> 18 05452a f7c43c -#> 19 05452a f7c43c -#> 20 05452a f7c43c -#> 21 05452a f7c43c

    -
    +#> team_color team_alternate_color +#> 1 000000 c7cfd4 +#> 2 000000 c7cfd4 +#> 3 000000 c7cfd4 +#> 4 000000 c7cfd4 +#> 5 000000 c7cfd4 +#> 6 000000 c7cfd4 +#> 7 000000 c7cfd4 +#> 8 000000 c7cfd4 +#> 9 000000 c7cfd4 +#> 10 000000 c7cfd4 +#> 11 05452a f7c43c +#> 12 05452a f7c43c +#> 13 05452a f7c43c +#> 14 05452a f7c43c +#> 15 05452a f7c43c +#> 16 05452a f7c43c +#> 17 05452a f7c43c +#> 18 05452a f7c43c +#> 19 05452a f7c43c +#> 20 05452a f7c43c +#> 21 05452a f7c43c
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -257,7 +263,7 @@

    Examp #> # away_team_name <chr>, away_team_logo <chr>, away_team_abb <chr>, #> # away_team_id <chr>, away_team_location <chr>, away_team_full <chr>, #> # away_team_color <chr>, away_score <int>, away_win <int>, away_record <chr>, -#> # status_name <chr>, startDate <chr>
    # Get schedule from date 2020-08-29 +#> # status_name <chr>, start_date <chr>
    # Get schedule from date 2020-08-29 espn_wnba_scoreboard (season = "20200829")
    #> # A tibble: 3 x 31 #> matchup matchup_short season type slug game_id game_uid game_date attendance @@ -272,7 +278,7 @@

    Examp #> # away_team_logo <chr>, away_team_abb <chr>, away_team_id <chr>, #> # away_team_location <chr>, away_team_full <chr>, away_team_color <chr>, #> # away_score <int>, away_win <int>, away_record <chr>, status_name <chr>, -#> # startDate <chr>

    +#> # start_date <chr> @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -231,11 +237,9 @@

    AuthorSaiem Gilani

    Examples

    -
    - - espn_wnba_team_box(game_id = 401244185) +
    espn_wnba_team_box(game_id = 401244185)
    #> # A tibble: 21 x 3 -#> Home label Away +#> home label away #> <chr> <chr> <chr> #> 1 Storm Team Aces #> 2 38-80 FG 22-64 @@ -247,8 +251,7 @@

    Examp #> 8 42 Rebounds 33 #> 9 11 Offensive Rebounds 7 #> 10 31 Defensive Rebounds 26 -#> # ... with 11 more rows

    -
    +#> # ... with 11 more rows
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -223,27 +229,23 @@

    AuthorSaiem Gilani

    Examples

    -
    -espn_wnba_teams() -
    #> # A tibble: 12 x 18 -#> id uid slug location name abbreviation displayName shortDisplayName -#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> -#> 1 20 s:40~~ atlant~ Atlanta Dream ATL Atlanta Dr~ Dream -#> 2 19 s:40~~ chicag~ Chicago Sky CHI Chicago Sky Sky -#> 3 18 s:40~~ connec~ Connect~ Sun CONN Connecticu~ Sun -#> 4 3 s:40~~ dallas~ Dallas Wings DAL Dallas Win~ Wings -#> 5 5 s:40~~ indian~ Indiana Fever IND Indiana Fe~ Fever -#> 6 17 s:40~~ las-ve~ Las Veg~ Aces LV Las Vegas ~ Aces -#> 7 6 s:40~~ los-an~ Los Ang~ Spar~ LA Los Angele~ Sparks -#> 8 8 s:40~~ minnes~ Minneso~ Lynx MIN Minnesota ~ Lynx -#> 9 9 s:40~~ new-yo~ New York Libe~ NY New York L~ Liberty -#> 10 11 s:40~~ phoeni~ Phoenix Merc~ PHX Phoenix Me~ Mercury -#> 11 14 s:40~~ seattl~ Seattle Storm SEA Seattle St~ Storm -#> 12 16 s:40~~ washin~ Washing~ Myst~ WSH Washington~ Mystics -#> # ... with 10 more variables: color <chr>, alternateColor <chr>, -#> # isActive <lgl>, isAllStar <lgl>, logos_href_1 <chr>, logos_href_2 <chr>, -#> # logos_href_3 <chr>, logos_href_4 <chr>, record <df[,1]>, links <list>
    -
    +
    espn_wnba_teams() +
    #> # A tibble: 12 x 10 +#> team_id team mascot display_name short_name abbreviation color +#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> +#> 1 20 Atlanta Dream Atlanta Dream Dream ATL d02030 +#> 2 19 Chicago Sky Chicago Sky Sky CHI 4f91cd +#> 3 18 Connecticut Sun Connecticut Sun Sun CONN de6b36 +#> 4 3 Dallas Wings Dallas Wings Wings DAL 11213e +#> 5 5 Indiana Fever Indiana Fever Fever IND e2382f +#> 6 17 Las Vegas Aces Las Vegas Aces Aces LV 000000 +#> 7 6 Los Angeles Sparks Los Angeles Sparks Sparks LA 532481 +#> 8 8 Minnesota Lynx Minnesota Lynx Lynx MIN 005084 +#> 9 9 New York Liberty New York Liberty Liberty NY 0d79b9 +#> 10 11 Phoenix Mercury Phoenix Mercury Mercury PHX 3a267d +#> 11 14 Seattle Storm Seattle Storm Storm SEA 05452a +#> 12 16 Washington Mystics Washington Mystics Mystics WSH e03a3e +#> # ... with 3 more variables: alternate_color <chr>, logo <chr>, logo_dark <chr>
    @@ -129,6 +132,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -154,7 +160,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -217,11 +223,20 @@

    Reference

    + + +

    wehoop Data

    +

    + + + + + -

    Exported Functions

    -

    Functions exported by wehoop

    +

    Women's College Basketball Data Functions

    +

    Functions exported by wehoop to access the wehoop-data repository’s Women’s College Basketball Data

    @@ -231,39 +246,92 @@

    espn_wnba_game_all()

    +

    load_wbb_pbp()

    -

    Get ESPN's WNBA game data (play-by-play, team and player box)

    +

    Load wehoop women's college basketball play-by-play

    -

    espn_wnba_pbp()

    +

    load_wbb_team_box()

    -

    Get ESPN's WNBA play by play data

    +

    Load wehoop women's college basketball team box scores

    -

    espn_wnba_team_box()

    +

    load_wbb_player_box()

    -

    Get ESPN's WNBA team box data

    +

    Load wehoop women's college basketball player box scores

    -

    espn_wnba_player_box()

    +

    update_wbb_db()

    -

    Get ESPN's WNBA player box data

    +

    Update or create a wehoop play-by-play database

    + + + + + +

    WNBA Data Functions

    +

    Functions exported by wehoop to access the wehoop-data repository’s WNBA Data

    + + + + + + + + + +

    load_wnba_pbp()

    + +

    Load wehoop WNBA play-by-play

    -

    espn_wnba_teams()

    +

    load_wnba_team_box()

    -

    Get ESPN's WNBA team names and ids

    +

    Load wehoop WNBA team box scores

    -

    espn_wnba_scoreboard()

    +

    load_wnba_player_box()

    -

    Get WNBA schedule for a specific year/date from ESPN's API

    +

    Load wehoop WNBA player box scores

    + + + +

    update_wnba_db()

    + +

    Update or create a wehoop play-by-play database

    + + + + +

    ESPN Data

    +

    + + + + + + + + +

    Women's College Basketball Data Functions

    +

    Functions exported by wehoop to access ESPN’s Women’s College Basketball Data

    + + + + + + + + + +

    espn_wbb_conferences()

    + +

    Get women's college basketball conferences

    @@ -279,15 +347,27 @@

    espn_wbb_team_box()

    +

    espn_wbb_player_box()

    -

    Get ESPN women's college basketball team box data

    +

    Get ESPN women's college basketball player box

    -

    espn_wbb_player_box()

    +

    espn_wbb_rankings()

    -

    Get ESPN women's college basketball player box

    +

    Get women's college basketball AP and Coaches poll rankings

    + + + +

    espn_wbb_scoreboard()

    + +

    Get women's college basketball schedule for a specific year from ESPN's API

    + + + +

    espn_wbb_standings()

    + +

    Get ESPN women's college basketball standings

    @@ -297,21 +377,92 @@

    espn_wbb_scoreboard()

    +

    espn_wbb_team_box()

    -

    Get women's college basketball schedule for a specific year from ESPN's API

    +

    Get ESPN women's college basketball team box data

    + + + + + +

    WNBA Data Functions

    +

    Functions exported by wehoop to access ESPN’s WNBA Data

    + + + + + + + + + +

    espn_wnba_game_all()

    + +

    Get ESPN's WNBA game data (play-by-play, team and player box)

    -

    ncaa_wbb_NET_rankings()

    +

    espn_wnba_pbp()

    -

    Get Women's college basketball NET rankings for the current date from the NCAA website

    +

    Get ESPN's WNBA play by play data

    -

    espn_wbb_rankings()

    +

    espn_wnba_player_box()

    -

    Get women's college basketball AP and Coaches poll rankings

    +

    Get ESPN's WNBA player box data

    + + + +

    espn_wnba_scoreboard()

    + +

    Get WNBA schedule for a specific year/date from ESPN's API

    + + + +

    espn_wnba_standings()

    + +

    Get ESPN WNBA Standings

    + + + +

    espn_wnba_teams()

    + +

    Get ESPN's WNBA team names and ids

    + + + +

    espn_wnba_team_box()

    + +

    Get ESPN's WNBA team box data

    + + + + +

    NCAA Data

    +

    + + + + + + + + +

    NCAA Data Functions

    +

    Functions exported by wehoop to access NCAA Women’s College Basketball Data

    + + + + + + + + + +

    ncaa_wbb_NET_rankings()

    + +

    Get Women's college basketball NET rankings for the current date from the NCAA website

    diff --git a/docs/reference/ncaa_wbb_NET_rankings.html b/docs/reference/ncaa_wbb_NET_rankings.html index 6b2d7f30..7fcafe36 100644 --- a/docs/reference/ncaa_wbb_NET_rankings.html +++ b/docs/reference/ncaa_wbb_NET_rankings.html @@ -50,7 +50,10 @@ - + + + + @@ -92,7 +95,7 @@ wehoop - 0.3.0 + 1.0.0 @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR @@ -229,18 +235,18 @@

    Examp
    # Get current NCAA NET rankings ncaa_wbb_NET_rankings()
    #> # A tibble: 343 x 9 -#> Rank Previous School Conference Record Road Neutral Home `Non Div I` -#> <int> <int> <chr> <chr> <chr> <chr> <chr> <chr> <chr> -#> 1 1 1 Stanford Pac-12 31-2 13-1 12-1 6-0 0-0 -#> 2 2 2 UConn Big East 28-2 10-1 7-1 11-0 0-0 -#> 3 3 3 Baylor Big 12 28-3 10-1 6-1 12-1 0-0 -#> 4 4 5 Maryland Big Ten 26-3 9-1 7-2 10-0 0-0 -#> 5 5 4 South Carol~ SEC 26-5 7-3 9-1 10-1 0-0 -#> 6 6 6 Louisville ACC 26-4 7-1 6-2 13-1 0-0 -#> 7 7 15 Arizona Pac-12 21-6 4-3 6-2 11-1 0-0 -#> 8 8 8 UCLA Pac-12 17-6 5-2 4-2 8-2 0-0 -#> 9 9 9 Indiana Big Ten 21-6 8-2 3-2 10-2 0-0 -#> 10 10 10 Oregon Pac-12 15-9 6-2 2-3 7-4 0-0 +#> rank previous school conference record road neutral home non_div_i +#> <int> <int> <chr> <chr> <chr> <chr> <chr> <chr> <chr> +#> 1 1 1 Stanford Pac-12 31-2 13-1 12-1 6-0 0-0 +#> 2 2 2 UConn Big East 28-2 10-1 7-1 11-0 0-0 +#> 3 3 3 Baylor Big 12 28-3 10-1 6-1 12-1 0-0 +#> 4 4 5 Maryland Big Ten 26-3 9-1 7-2 10-0 0-0 +#> 5 5 4 South Carolina SEC 26-5 7-3 9-1 10-1 0-0 +#> 6 6 6 Louisville ACC 26-4 7-1 6-2 13-1 0-0 +#> 7 7 15 Arizona Pac-12 21-6 4-3 6-2 11-1 0-0 +#> 8 8 8 UCLA Pac-12 17-6 5-2 4-2 8-2 0-0 +#> 9 9 9 Indiana Big Ten 21-6 8-2 3-2 10-2 0-0 +#> 10 10 10 Oregon Pac-12 15-9 6-2 2-3 7-4 0-0 #> # ... with 333 more rows
    @@ -130,6 +133,9 @@
  • Vignettes
  • +
  • + Getting started +
  • @@ -155,7 +161,7 @@ cfbfastR
  • - kenpomR + hoopR
  • cfbrecruitR diff --git a/docs/sitemap.xml b/docs/sitemap.xml index b65fa45a..86244a01 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -3,6 +3,9 @@ https://saiemgilani.github.io/wehoop/index.html + + https://saiemgilani.github.io/wehoop/reference/espn_wbb_conferences.html + https://saiemgilani.github.io/wehoop/reference/espn_wbb_game_all.html @@ -18,6 +21,9 @@ https://saiemgilani.github.io/wehoop/reference/espn_wbb_scoreboard.html + + https://saiemgilani.github.io/wehoop/reference/espn_wbb_standings.html + https://saiemgilani.github.io/wehoop/reference/espn_wbb_teams.html @@ -36,16 +42,49 @@ https://saiemgilani.github.io/wehoop/reference/espn_wnba_scoreboard.html + + https://saiemgilani.github.io/wehoop/reference/espn_wnba_standings.html + https://saiemgilani.github.io/wehoop/reference/espn_wnba_teams.html https://saiemgilani.github.io/wehoop/reference/espn_wnba_team_box.html + + https://saiemgilani.github.io/wehoop/reference/load_wbb_pbp.html + + + https://saiemgilani.github.io/wehoop/reference/load_wbb_player_box.html + + + https://saiemgilani.github.io/wehoop/reference/load_wbb_team_box.html + + + https://saiemgilani.github.io/wehoop/reference/load_wnba_pbp.html + + + https://saiemgilani.github.io/wehoop/reference/load_wnba_player_box.html + + + https://saiemgilani.github.io/wehoop/reference/load_wnba_team_box.html + https://saiemgilani.github.io/wehoop/reference/ncaa_wbb_NET_rankings.html https://saiemgilani.github.io/wehoop/reference/pipe.html + + https://saiemgilani.github.io/wehoop/reference/update_wbb_db.html + + + https://saiemgilani.github.io/wehoop/reference/update_wnba_db.html + + + https://saiemgilani.github.io/wehoop/reference/wehoop-package.html + + + https://saiemgilani.github.io/wehoop/articles/getting-started-wehoop.html + diff --git a/man/espn_wbb_game_all.Rd b/man/espn_wbb_game_all.Rd index 36052f82..86111aba 100644 --- a/man/espn_wbb_game_all.Rd +++ b/man/espn_wbb_game_all.Rd @@ -4,12 +4,10 @@ \alias{espn_wbb_game_all} \title{Get ESPN women's college basketball game data (play-by-play, team and player box)} \usage{ -espn_wbb_game_all(game_id, verbose = FALSE) +espn_wbb_game_all(game_id) } \arguments{ \item{game_id}{Game ID} - -\item{verbose}{Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function} } \description{ Get ESPN women's college basketball game data (play-by-play, team and player box) diff --git a/man/espn_wbb_pbp.Rd b/man/espn_wbb_pbp.Rd index 0b4fc61f..648efe85 100644 --- a/man/espn_wbb_pbp.Rd +++ b/man/espn_wbb_pbp.Rd @@ -4,12 +4,10 @@ \alias{espn_wbb_pbp} \title{Get ESPN women's college basketball play by play data} \usage{ -espn_wbb_pbp(game_id, verbose = FALSE) +espn_wbb_pbp(game_id) } \arguments{ \item{game_id}{Game ID} - -\item{verbose}{Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function} } \description{ Get ESPN women's college basketball play by play data diff --git a/man/espn_wbb_player_box.Rd b/man/espn_wbb_player_box.Rd index 2d19d8f8..e2b0cfef 100644 --- a/man/espn_wbb_player_box.Rd +++ b/man/espn_wbb_player_box.Rd @@ -4,12 +4,10 @@ \alias{espn_wbb_player_box} \title{Get ESPN women's college basketball player box} \usage{ -espn_wbb_player_box(game_id, verbose = FALSE) +espn_wbb_player_box(game_id) } \arguments{ \item{game_id}{Game ID} - -\item{verbose}{Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function} } \description{ Get ESPN women's college basketball player box diff --git a/man/espn_wbb_scoreboard.Rd b/man/espn_wbb_scoreboard.Rd index f71c1901..25b184c6 100644 --- a/man/espn_wbb_scoreboard.Rd +++ b/man/espn_wbb_scoreboard.Rd @@ -4,12 +4,10 @@ \alias{espn_wbb_scoreboard} \title{Get women's college basketball schedule for a specific year from ESPN's API} \usage{ -espn_wbb_scoreboard(season, verbose = FALSE) +espn_wbb_scoreboard(season) } \arguments{ \item{season}{Either numeric or character} - -\item{verbose}{Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function} } \value{ Returns a tibble diff --git a/man/espn_wbb_standings.Rd b/man/espn_wbb_standings.Rd new file mode 100644 index 00000000..3bab2ed9 --- /dev/null +++ b/man/espn_wbb_standings.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/espn_wbb_data.R +\name{espn_wbb_standings} +\alias{espn_wbb_standings} +\title{Get ESPN women's college basketball standings} +\usage{ +espn_wbb_standings(year) +} +\arguments{ +\item{year}{Either numeric or character (YYYY)} +} +\description{ +Get ESPN women's college basketball standings +} +\examples{ +espn_wbb_standings(2021) +} +\keyword{Standings} +\keyword{WBB} diff --git a/man/espn_wbb_team_box.Rd b/man/espn_wbb_team_box.Rd index ef3b2cdd..3b3c8a99 100644 --- a/man/espn_wbb_team_box.Rd +++ b/man/espn_wbb_team_box.Rd @@ -4,12 +4,10 @@ \alias{espn_wbb_team_box} \title{Get ESPN women's college basketball team box data} \usage{ -espn_wbb_team_box(game_id, verbose = FALSE) +espn_wbb_team_box(game_id) } \arguments{ \item{game_id}{Game ID} - -\item{verbose}{Logical parameter (TRUE/FALSE, default: FALSE) to return warnings and messages from function} } \description{ Get ESPN women's college basketball team box data diff --git a/man/espn_wnba_standings.Rd b/man/espn_wnba_standings.Rd new file mode 100644 index 00000000..117687cd --- /dev/null +++ b/man/espn_wnba_standings.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/espn_wnba_data.R +\name{espn_wnba_standings} +\alias{espn_wnba_standings} +\title{Get ESPN WNBA Standings} +\usage{ +espn_wnba_standings(year) +} +\arguments{ +\item{year}{Either numeric or character (YYYY)} +} +\description{ +Get ESPN WNBA Standings +} +\examples{ +\dontrun{ +espn_wnba_standings(year = 2021) +} +} +\author{ +Geoff Hutchinson +} +\keyword{Standings} +\keyword{WNBA} diff --git a/man/load_wbb_pbp.Rd b/man/load_wbb_pbp.Rd index 2464ba67..c4f8cecf 100644 --- a/man/load_wbb_pbp.Rd +++ b/man/load_wbb_pbp.Rd @@ -18,3 +18,9 @@ the season data into a database (used by \code{\link[=update_wbb_db]{update_wbb_ helper that loads multiple seasons from the data repo either into memory or writes it into a db using some forwarded arguments in the dots } +\examples{ +\dontrun{ +future::plan("multisession") +load_wbb_pbp(2002:2021) +} +} diff --git a/man/load_wbb_player_box.Rd b/man/load_wbb_player_box.Rd new file mode 100644 index 00000000..12eee921 --- /dev/null +++ b/man/load_wbb_player_box.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/wbb_pbp.R +\name{load_wbb_player_box} +\alias{load_wbb_player_box} +\title{\strong{Load wehoop women's college basketball player box scores}} +\usage{ +load_wbb_player_box(seasons, ..., qs = FALSE) +} +\arguments{ +\item{seasons}{A vector of 4-digit years associated with given women's college basketball seasons.} + +\item{...}{Additional arguments passed to an underlying function that writes +the season data into a database (used by \code{\link[=update_wbb_db]{update_wbb_db()}}).} + +\item{qs}{Wheter to use the function \code{\link[qs:qdeserialize]{qs::qdeserialize()}} for more efficient loading.} +} +\description{ +helper that loads multiple seasons from the data repo either into memory +or writes it into a db using some forwarded arguments in the dots +} +\examples{ +\dontrun{ +future::plan("multisession") +load_wbb_player_box(2002:2021) +} +} diff --git a/man/load_wbb_team_box.Rd b/man/load_wbb_team_box.Rd new file mode 100644 index 00000000..fb72fed8 --- /dev/null +++ b/man/load_wbb_team_box.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/wbb_pbp.R +\name{load_wbb_team_box} +\alias{load_wbb_team_box} +\title{\strong{Load wehoop women's college basketball team box scores}} +\usage{ +load_wbb_team_box(seasons, ..., qs = FALSE) +} +\arguments{ +\item{seasons}{A vector of 4-digit years associated with given women's college basketball seasons.} + +\item{...}{Additional arguments passed to an underlying function that writes +the season data into a database (used by \code{\link[=update_wbb_db]{update_wbb_db()}}).} + +\item{qs}{Wheter to use the function \code{\link[qs:qdeserialize]{qs::qdeserialize()}} for more efficient loading.} +} +\description{ +helper that loads multiple seasons from the data repo either into memory +or writes it into a db using some forwarded arguments in the dots +} +\examples{ +\dontrun{ +future::plan("multisession") +load_wbb_team_box(2002:2021) +} +} diff --git a/man/load_wnba_pbp.Rd b/man/load_wnba_pbp.Rd index bbede7c5..7bf8cdb6 100644 --- a/man/load_wnba_pbp.Rd +++ b/man/load_wnba_pbp.Rd @@ -18,3 +18,9 @@ the season data into a database (used by \code{\link[=update_wnba_db]{update_wnb helper that loads multiple seasons from the data repo either into memory or writes it into a db using some forwarded arguments in the dots } +\examples{ +\dontrun{ +future::plan("multisession") +load_wnba_pbp(2002:2021) +} +} diff --git a/man/load_wnba_player_box.Rd b/man/load_wnba_player_box.Rd new file mode 100644 index 00000000..fd9194fa --- /dev/null +++ b/man/load_wnba_player_box.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/wnba_pbp.R +\name{load_wnba_player_box} +\alias{load_wnba_player_box} +\title{\strong{Load wehoop WNBA player box scores}} +\usage{ +load_wnba_player_box(seasons, ..., qs = FALSE) +} +\arguments{ +\item{seasons}{A vector of 4-digit years associated with given WNBA seasons.} + +\item{...}{Additional arguments passed to an underlying function that writes +the season data into a database (used by \code{\link[=update_wnba_db]{update_wnba_db()}}).} + +\item{qs}{Wheter to use the function \code{\link[qs:qdeserialize]{qs::qdeserialize()}} for more efficient loading.} +} +\description{ +helper that loads multiple seasons from the data repo either into memory +or writes it into a db using some forwarded arguments in the dots +} +\examples{ +\dontrun{ +future::plan("multisession") +load_wnba_player_box(2002:2021) +} +} diff --git a/man/load_wnba_team_box.Rd b/man/load_wnba_team_box.Rd new file mode 100644 index 00000000..a783f7a7 --- /dev/null +++ b/man/load_wnba_team_box.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/wnba_pbp.R +\name{load_wnba_team_box} +\alias{load_wnba_team_box} +\title{\strong{Load wehoop WNBA team box scores}} +\usage{ +load_wnba_team_box(seasons, ..., qs = FALSE) +} +\arguments{ +\item{seasons}{A vector of 4-digit years associated with given WNBA seasons.} + +\item{...}{Additional arguments passed to an underlying function that writes +the season data into a database (used by \code{\link[=update_wnba_db]{update_wnba_db()}}).} + +\item{qs}{Wheter to use the function \code{\link[qs:qdeserialize]{qs::qdeserialize()}} for more efficient loading.} +} +\description{ +helper that loads multiple seasons from the data repo either into memory +or writes it into a db using some forwarded arguments in the dots +} +\examples{ +\dontrun{ +future::plan("multisession") +load_wnba_team_box(2002:2021) +} +} diff --git a/man/update_wbb_db.Rd b/man/update_wbb_db.Rd index 21a611b6..7d37996b 100644 --- a/man/update_wbb_db.Rd +++ b/man/update_wbb_db.Rd @@ -9,7 +9,7 @@ \usage{ update_wbb_db( dbdir = ".", - dbname = "wbb_pbp_db", + dbname = "wehoop_db", tblname = "wehoop_wbb_pbp", force_rebuild = FALSE, db_connection = NULL diff --git a/man/update_wnba_db.Rd b/man/update_wnba_db.Rd index 3bc51c94..8ce12233 100644 --- a/man/update_wnba_db.Rd +++ b/man/update_wnba_db.Rd @@ -9,7 +9,7 @@ \usage{ update_wnba_db( dbdir = ".", - dbname = "wnba_pbp_db", + dbname = "wehoop_db", tblname = "wehoop_wnba_pbp", force_rebuild = FALSE, db_connection = NULL diff --git a/tests/testthat/test-espn_wbb_standings.R b/tests/testthat/test-espn_wbb_standings.R new file mode 100644 index 00000000..96fb0892 --- /dev/null +++ b/tests/testthat/test-espn_wbb_standings.R @@ -0,0 +1,38 @@ + +cols <- c( + "team_id","team","playoffseed","wins","losses", + "winpercent","gamesbehind","pointsfor","pointsagainst", + "avgpointsfor","avgpointsagainst","streak", + "leaguewinpercent","total","home_playoffseed", + "home_wins","home_losses","home_winpercent", + "home_gamesbehind","home_pointsfor","home_pointsagainst", + "home_avgpointsfor","home_avgpointsagainst", + "home_streak","home_leaguewinpercent","home", + "road_playoffseed","road_wins","road_losses", + "road_winpercent","road_gamesbehind","road_pointsfor", + "road_pointsagainst","road_avgpointsfor", + "road_avgpointsagainst","road_streak","road_leaguewinpercent", + "road","vsaprankedteams_playoffseed","vsaprankedteams_wins", + "vsaprankedteams_losses","vsaprankedteams_winpercent", + "vsaprankedteams_gamesbehind","vsaprankedteams_pointsfor", + "vsaprankedteams_pointsagainst","vsaprankedteams_avgpointsfor", + "vsaprankedteams_avgpointsagainst","vsaprankedteams_streak", + "vsaprankedteams_leaguewinpercent","vsaprankedteams", + "vsusarankedteams_playoffseed","vsusarankedteams_wins", + "vsusarankedteams_losses","vsusarankedteams_winpercent", + "vsusarankedteams_gamesbehind","vsusarankedteams_pointsfor", + "vsusarankedteams_pointsagainst","vsusarankedteams_avgpointsfor", + "vsusarankedteams_avgpointsagainst","vsusarankedteams_streak", + "vsusarankedteams_leaguewinpercent","vsusarankedteams", + "vsconf_playoffseed","vsconf_wins","vsconf_losses", + "vsconf_winpercent","vsconf_gamesbehind","vsconf_pointsfor", + "vsconf_pointsagainst","vsconf_avgpointsfor","vsconf_avgpointsagainst", + "vsconf_streak","vsconf_leaguewinpercent","vsconf" +) + +test_that("ESPN - WBB Standings", { + skip_on_cran() + x <- espn_wbb_standings(year = 2021) + expect_equal(colnames(x), cols) + expect_s3_class(x, "data.frame") +}) diff --git a/tests/testthat/test-espn_wnba_standings.R b/tests/testthat/test-espn_wnba_standings.R new file mode 100644 index 00000000..ec845895 --- /dev/null +++ b/tests/testthat/test-espn_wnba_standings.R @@ -0,0 +1,15 @@ + +cols <- c( + "team_id","team","playoffseed","wins","losses", + "winpercent","gamesbehind","avgpointsfor", + "avgpointsagainst","differential","streak", + "divisionwinpercent","leaguewinpercent","leaguestandings", + "home","road","vsdiv","vsconf","lasttengames" +) + +test_that("ESPN - WNBA Standings", { + skip_on_cran() + x <- espn_wnba_standings(year = 2021) + expect_equal(colnames(x), cols) + expect_s3_class(x, "data.frame") +}) diff --git a/vignettes/getting-started-wehoop.Rmd b/vignettes/getting-started-wehoop.Rmd new file mode 100644 index 00000000..349b5f39 --- /dev/null +++ b/vignettes/getting-started-wehoop.Rmd @@ -0,0 +1,144 @@ +--- +title: "Getting Started with wehoop" +description: "Getting started with using wehoop and women's basketball data." +author: "Saiem Gilani
    @saiemgilani @saiemgilani" +opengraph: + image: + src: "https://github.com/saiemgilani/wehoop-data/blob/master/themes/wehoop_gh.png?raw=true" + twitter: + card: summary_large_image + creator: "@saiemgilani" +output: html_document +--- +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +pacman::p_load_current_gh("r-lib/pkgapi") +pacman::p_load_current_gh("hadley/emo") +library(pkgapi) +pkg <- pkgapi::map_package(path = "../") +library(dplyr) +exported <- pkg$defs %>% dplyr::filter(exported == TRUE) + +pkg_name <- "saiemgilani/wehoop" +url <- paste0("https://raw.githubusercontent.com/", pkg_name, "/master/DESCRIPTION") + + +x <- readLines(url) +remote_version <- gsub("Version:\\s*", "", x[grep('Version:', x)]) +``` + +Welcome folks, + +I'm Saiem Gilani, one of the [authors](https://saiemgilani.github.io/wehoop/authors.html "Authors and contributors to wehoop") of [`wehoop`](https://saiemgilani.github.io/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 +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 + +3. Head to [RStudio.com](https://www.rstudio.com/products/rstudio/download/#download "Download the appropriate version of RStudio (Free) for your operating system to use with R") +4. Follow the associated download and installation instructions for RStudio. +5. Start peering over the [RStudio IDE Cheatsheet](https://github.com/rstudio/cheatsheets/raw/master/rstudio-ide.pdf). *An IDE is an integrated development environment.* + + +## **Install** [**`wehoop`**](https://saiemgilani.github.io/wehoop/) +```{r install_wehoop_gs, message=FALSE,eval=FALSE} +# 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/wehoop") +``` + +## **Quick Start** + +### **WNBA full play-by-play seasons (2002-2021) ~ 1-2 minutes** +```{r load_wnba_pbp_2002_2021, warning = FALSE} +future::plan("multisession") +tictoc::tic() +progressr::with_progress({ + wnba_pbp <- wehoop::load_wnba_pbp(2002:2021) +}) +tictoc::toc() +## 10.36 sec elapsed +length(unique(wnba_pbp$game_id)) +nrow(wnba_pbp) +``` +### **WNBA full team box score seasons (2002-2021) ~ 5-30 seconds** +```{r load_wnba_team_2002_2021, warning = FALSE} +future::plan("multisession") +tictoc::tic() +progressr::with_progress({ + wnba_team_box <- wehoop::load_wnba_team_box(2002:2021) +}) +tictoc::toc() +length(unique(wnba_team_box$game_id)) +nrow(wnba_team_box) +``` +### **WNBA full player box score seasons (2002-2021) ~ 5-30 seconds** +```{r load_wnba_player_2002_2021, warning = FALSE} +future::plan("multisession") +tictoc::tic() +progressr::with_progress({ + wnba_player_box <- wehoop::load_wnba_player_box(2002:2021) +}) +tictoc::toc() +length(unique(wnba_player_box$game_id)) +nrow(wnba_player_box) +``` + +### **Women's college basketball full play-by-play seasons (2002-2021) ~ 45-90 seconds** + +```{r load_wbb_pbp_2002_2021, warning = FALSE} +future::plan("multisession") +tictoc::tic() +progressr::with_progress({ + wbb_pbp <- wehoop::load_wbb_pbp(2002:2021) +}) +tictoc::toc() +length(unique(wbb_pbp$game_id)) +nrow(wbb_pbp) +``` + +### **Women's college basketball full team box score seasons (2002-2021) ~ 5-30 seconds** + +```{r load_wbb_team_2002_2021, warning = FALSE} +future::plan("multisession") +tictoc::tic() +progressr::with_progress({ + wbb_team_box <- wehoop::load_wbb_team_box(2002:2021) +}) +tictoc::toc() +length(unique(wbb_team_box$game_id)) +nrow(wbb_team_box) +``` + +### **Women's college basketball full player box score seasons (2002-2021) ~ 5-30 seconds** + +```{r load_wbb_player_2002_2021, warning = FALSE} +future::plan("multisession") +tictoc::tic() +progressr::with_progress({ + wbb_player_box <- wehoop::load_wbb_player_box(2002:2021) +}) +tictoc::toc() +length(unique(wbb_player_box$game_id)) +nrow(wbb_player_box) +``` + + +# **Our Authors** + +- [Saiem Gilani](https://twitter.com/saiemgilani) +@saiemgilani +@saiemgilani + +- [Geoff Hutchinson](https://twitter.com/hutchngo) +@hutchngo +@hutchngo + +