Skip to content

Commit

Permalink
Devel (#35)
Browse files Browse the repository at this point in the history
* add betting functions

* docs

* Update CHANGELOG.md

* addressing empty data frame issue #32

* addressing empty data frame issue #32

* update loaders and docs

* kp docs

* Small documentation, install direction changes

* website links and small getting started vignette for loaders

* Fix home/away issue when presented out of order

* update nba schedule docs

* rcmd check issues

* tryin some stuff

* tryin some more stuff

* Update utils.R

* rem

* trying some more stuff really right this time

* Update utils.R

* rd

* rem example

* update nba betting example

* ex

* add rbindlist fill == true

* ex

* ex

* doc min years
  • Loading branch information
saiemgilani committed Oct 19, 2021
1 parent 0c1b3a4 commit 009b3cf
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 24 deletions.
8 changes: 4 additions & 4 deletions R/mbb_pbp.R
Expand Up @@ -6,7 +6,7 @@ NULL
#' @rdname load_mbb_pbp
#' @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 men's college basketball seasons.
#' @param seasons A vector of 4-digit years associated with given men's college basketball seasons. (Min: 2006)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_mbb_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down Expand Up @@ -54,7 +54,7 @@ NULL
#' @rdname load_mbb_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 men's college basketball seasons.
#' @param seasons A vector of 4-digit years associated with given men's college basketball seasons. (Min: 2003)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_mbb_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down Expand Up @@ -102,7 +102,7 @@ NULL
#' @rdname load_mbb_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 men's college basketball seasons.
#' @param seasons A vector of 4-digit years associated with given men's college basketball seasons. (Min: 2003)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_mbb_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down Expand Up @@ -149,7 +149,7 @@ NULL
#' @rdname load_mbb_schedule
#' @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 men's college basketball seasons.
#' @param seasons A vector of 4-digit years associated with given men's college basketball seasons. (Min: 2002)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_mbb_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down
8 changes: 4 additions & 4 deletions R/nba_pbp.R
Expand Up @@ -6,7 +6,7 @@ NULL
#' @rdname load_nba_pbp
#' @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 seasons A vector of 4-digit years associated with given NBA seasons. (Min: 2002)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_nba_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down Expand Up @@ -57,7 +57,7 @@ NULL
#' @rdname load_nba_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 NBA seasons.
#' @param seasons A vector of 4-digit years associated with given NBA seasons. (Min: 2002)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_nba_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down Expand Up @@ -102,7 +102,7 @@ NULL
#' @rdname load_nba_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 NBA seasons.
#' @param seasons A vector of 4-digit years associated with given NBA seasons. (Min: 2002)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_nba_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down Expand Up @@ -150,7 +150,7 @@ NULL
#' @rdname load_nba_schedule
#' @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 NBA seasons.
#' @param seasons A vector of 4-digit years associated with given NBA seasons. (Min: 2002)
#' @param ... Additional arguments passed to an underlying function that writes
#' the season data into a database (used by `update_nba_db()`).
#' @param dbConnection A `DBIConnection` object, as returned by
Expand Down
2 changes: 1 addition & 1 deletion man/load_mbb_pbp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/load_mbb_player_box.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/load_mbb_schedule.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/load_mbb_team_box.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/load_nba_pbp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/load_nba_player_box.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/load_nba_schedule.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/load_nba_team_box.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions vignettes/getting-started-hoopR.Rmd
Expand Up @@ -73,11 +73,12 @@ There are generally speaking **five** men's basketball data sources accessed fro

## **Quick Start**

### **NBA play-by-plays (2002-2021) ~ 30-60 seconds**
For the sake of your R session, we will only look at the previous 5 years of data, but I have indicated the years to which the data goes back to.
### **NBA play-by-plays (2002-2021) ~ 60-120 seconds**
```{r load_nba_pbp_gs, warning = FALSE}
tictoc::tic()
progressr::with_progress({
nba_pbp <- hoopR::load_nba_pbp(2002:2021)
nba_pbp <- hoopR::load_nba_pbp(2016:2021)
})
tictoc::toc()
glue::glue("{nrow(nba_pbp)} rows of nba play-by-play data from {length(unique(nba_pbp$game_id))} games.")
Expand All @@ -88,7 +89,7 @@ dplyr::glimpse(nba_pbp)
```{r load_nba_team_gs, warning = FALSE}
tictoc::tic()
progressr::with_progress({
nba_team_box <- hoopR::load_nba_team_box(2002:2021)
nba_team_box <- hoopR::load_nba_team_box(2016:2021)
})
tictoc::toc()
Expand All @@ -101,20 +102,21 @@ dplyr::glimpse(nba_team_box)
```{r load_nba_player_gs, warning = FALSE}
tictoc::tic()
progressr::with_progress({
nba_player_box <- hoopR::load_nba_player_box(2002:2021)
nba_player_box <- hoopR::load_nba_player_box(2016:2021)
})
tictoc::toc()
glue::glue("{nrow(nba_player_box)} rows of NBA player boxscore data from {length(unique(nba_player_box$game_id))} games.")
dplyr::glimpse(nba_player_box)
```

### **Men's college basketball play-by-plays (2006-2021) ~ 45-90 seconds**

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

```{r load_mbb_pbp_gs, warning = FALSE}
tictoc::tic()
progressr::with_progress({
mbb_pbp <- hoopR::load_mbb_pbp(2006:2021)
mbb_pbp <- hoopR::load_mbb_pbp(2016:2021)
})
tictoc::toc()
glue::glue("{nrow(mbb_pbp)} rows of men's college basketball play-by-play data from {length(unique(mbb_pbp$game_id))} games.")
Expand All @@ -126,7 +128,7 @@ dplyr::glimpse(mbb_pbp)
```{r load_mbb_team_gs, warning = FALSE}
tictoc::tic()
progressr::with_progress({
mbb_team_box <- hoopR::load_mbb_team_box(2003:2021)
mbb_team_box <- hoopR::load_mbb_team_box(2016:2021)
})
tictoc::toc()
glue::glue("{nrow(mbb_team_box)} rows of men's college basketball team boxscore data from {length(unique(mbb_team_box$game_id))} games.")
Expand All @@ -138,7 +140,7 @@ dplyr::glimpse(mbb_team_box)
```{r load_mbb_player_gs, warning = FALSE}
tictoc::tic()
progressr::with_progress({
mbb_player_box <- hoopR::load_mbb_player_box(2003:2021)
mbb_player_box <- hoopR::load_mbb_player_box(2016:2021)
})
tictoc::toc()
Expand Down

1 comment on commit 009b3cf

@vercel
Copy link

@vercel vercel bot commented on 009b3cf Oct 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.