diff --git a/DESCRIPTION b/DESCRIPTION index 294528ee..07b212a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: hoopR Title: Functions to Access Men's Basketball Play by Play Data -Version: 1.4.2 +Version: 1.4.3 Authors@R: c(person(given = "Saiem", family = "Gilani", diff --git a/NAMESPACE b/NAMESPACE index b64aebaf..fe19ae3a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -195,7 +195,6 @@ export(nba_videostatus) export(nba_winprobabilitypbp) export(ncaa_mbb_NET_rankings) export(progressively) -export(rejoin_schedules) export(update_mbb_db) export(update_nba_db) export(year_to_season) diff --git a/NEWS.md b/NEWS.md index 308f14eb..8d987d2a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# **hoopR 1.4.3** +- Option configs changed to revert to user options + # **hoopR 1.4.2** - Implement additional boxscore function parameters for ```nba_boxscore(.*)``` functions diff --git a/R/espn_mbb_data.R b/R/espn_mbb_data.R index b8bb1347..7bad4b72 100644 --- a/R/espn_mbb_data.R +++ b/R/espn_mbb_data.R @@ -14,8 +14,8 @@ #' espn_mbb_game_all <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/mens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" @@ -196,8 +196,8 @@ espn_mbb_game_all <- function(game_id){ #' espn_mbb_pbp(game_id = 401256760) #' espn_mbb_pbp <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/mens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" @@ -259,8 +259,8 @@ espn_mbb_pbp <- function(game_id){ #' espn_mbb_team_box(game_id = 401256760) #' espn_mbb_team_box <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/mens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" ## Inputs @@ -365,8 +365,8 @@ espn_mbb_team_box <- function(game_id){ #' espn_mbb_player_box(game_id = 401256760) #' espn_mbb_player_box <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/mens-college-basketball/playbyplay?render=false&userab=1&xhr=1&" ## Inputs @@ -444,8 +444,8 @@ espn_mbb_player_box <- function(game_id){ #' espn_mbb_conferences() #' espn_mbb_conferences <- function(){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/scoreboard/conferences" res <- httr::RETRY("GET", play_base_url) @@ -487,8 +487,8 @@ espn_mbb_conferences <- function(){ #' espn_mbb_teams() #' espn_mbb_teams <- function(){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/teams?groups=50&limit=1000" res <- httr::RETRY("GET", play_base_url) @@ -758,8 +758,8 @@ ncaa_mbb_NET_rankings <- function(){ #' espn_mbb_rankings() espn_mbb_rankings <- function(){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) ranks_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/mens-college-basketball/rankings?groups=50" diff --git a/R/espn_nba_data.R b/R/espn_nba_data.R index d6df712a..3d23ae24 100644 --- a/R/espn_nba_data.R +++ b/R/espn_nba_data.R @@ -14,8 +14,8 @@ #' espn_nba_game_all <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/core/nba/playbyplay?render=false&userab=1&xhr=1&" @@ -193,8 +193,8 @@ espn_nba_game_all <- function(game_id){ #' espn_nba_pbp(game_id = 401283399) #' espn_nba_pbp <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/core/nba/playbyplay?render=false&userab=1&xhr=1&" @@ -259,8 +259,8 @@ espn_nba_pbp <- function(game_id){ #' espn_nba_team_box(game_id = 401283399) #' espn_nba_team_box <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/core/nba/playbyplay?render=false&userab=1&xhr=1&" ## Inputs @@ -363,8 +363,8 @@ espn_nba_team_box <- function(game_id){ #' espn_nba_player_box(game_id = 401283399) #' espn_nba_player_box <- function(game_id){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://cdn.espn.com/core/nba/playbyplay?render=false&userab=1&xhr=1&" ## Inputs @@ -443,8 +443,8 @@ espn_nba_player_box <- function(game_id){ #' espn_nba_teams <- function(){ - options(stringsAsFactors = FALSE) - options(scipen = 999) + old <- options(list(stringsAsFactors = FALSE, scipen = 999)) + on.exit(options(old)) play_base_url <- "http://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams?limit=1000" diff --git a/R/utils_nba_stats.R b/R/utils_nba_stats.R index ab084327..74387937 100644 --- a/R/utils_nba_stats.R +++ b/R/utils_nba_stats.R @@ -202,7 +202,6 @@ year_to_season <- function(year){ #' @importFrom dplyr mutate filter select left_join #' @importFrom stringr str_detect #' @importFrom tidyr everything -#' @export rejoin_schedules <- function(df){ df <- df %>% dplyr::mutate( diff --git a/docs/src/pages/CHANGELOG.md b/docs/src/pages/CHANGELOG.md index 308f14eb..8d987d2a 100644 --- a/docs/src/pages/CHANGELOG.md +++ b/docs/src/pages/CHANGELOG.md @@ -1,3 +1,6 @@ +# **hoopR 1.4.3** +- Option configs changed to revert to user options + # **hoopR 1.4.2** - Implement additional boxscore function parameters for ```nba_boxscore(.*)``` functions