Skip to content

clean up internal namespace and directly re-export nflreadr functions #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Imports:
glue,
janitor,
lifecycle,
magrittr,
Copy link
Member

Choose a reason for hiding this comment

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

I would like to get rid of the magrittr pipe and never imported it because the pipe is reexported in dplyr and we need to watch the number of dependencies

mgcv,
nflreadr (>= 1.2.0),
progressr (>= 0.6.0),
Expand Down
8 changes: 6 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ export(fast_scraper_roster)
export(fast_scraper_schedules)
export(load_pbp)
export(load_player_stats)
export(load_rosters)
export(load_schedules)
export(missing_raw_pbp)
export(nflverse_sitrep)
export(report)
export(save_raw_pbp)
export(update_db)
import(dplyr)
import(fastrmodels)
importFrom(data.table,"%between%")
importFrom(data.table,"%chin%")
importFrom(nflreadr,load_pbp)
importFrom(nflreadr,load_player_stats)
importFrom(nflreadr,load_rosters)
importFrom(nflreadr,load_schedules)
importFrom(nflreadr,nflverse_sitrep)
importFrom(rlang,"%||%")
importFrom(rlang,":=")
Expand Down
12 changes: 0 additions & 12 deletions R/load_pbp.R

This file was deleted.

30 changes: 0 additions & 30 deletions R/load_player_stats.R

This file was deleted.

12 changes: 12 additions & 0 deletions R/nflfastR-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,22 @@
## usethis namespace: start
#' @import dplyr
#' @import fastrmodels
#' @importFrom nflreadr load_pbp load_player_stats load_schedules load_rosters nflverse_sitrep
#' @importFrom data.table %between% %chin%
#' @importFrom rlang .data := .env %||%
# We have to import something from xgboost because it is listed as dependency to
# be able to apply models.
#' @importFrom xgboost getinfo
Copy link
Member

Choose a reason for hiding this comment

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

nflfastR needs xgboost to apply the models but there is no actual function call to xgboost which results in a R CMD Check note. That's why I import a dummy.

## usethis namespace: end
NULL

#' @export
nflreadr::load_pbp
#' @export
nflreadr::load_player_stats
#' @export
nflreadr::load_schedules
#' @export
nflreadr::load_rosters
#' @export
nflreadr::nflverse_sitrep
32 changes: 0 additions & 32 deletions R/report.R
Original file line number Diff line number Diff line change
@@ -1,32 +0,0 @@
#' Get a Situation Report on System, nflverse Package Versions and Dependencies
#'
#' @description This function gives a quick overview of the versions of R and
#' the operating system as well as the versions of nflverse packages, options,
#' and their dependencies. It's primarily designed to help you get a quick
#' idea of what's going on when you're helping someone else debug a problem.
#' @details See [`nflreadr::nflverse_sitrep`] for details.
#' @inheritDotParams nflreadr::nflverse_sitrep
#' @inherit nflreadr::nflverse_sitrep
#' @examples
#' \donttest{
#' \dontshow{
#' # set CRAN mirror to avoid failing checks in weird scenarios
#' old_ops <- options(repos = c("CRAN" = "https://cran.rstudio.com/"))
#' }
#'
#' report(recursive = FALSE)
#' nflverse_sitrep(pkg = "nflreadr", recursive = TRUE)
#'
#' \dontshow{
#' # restore old options
#' options(old_ops)
#' }
#' }
#' @export
report <- function(...) nflreadr::nflverse_sitrep(...)
Copy link
Member

Choose a reason for hiding this comment

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

Not happy with silently dropping the function report completely


#' @export
#' @name nflverse_sitrep
#' @rdname report
#' @importFrom nflreadr nflverse_sitrep
NULL
2 changes: 0 additions & 2 deletions R/top-level_scraper.R
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ fast_scraper <- function(game_ids,

#' Load Team Rosters for Multiple Seasons
#' @details See [`nflreadr::load_rosters`] for details.
#' @inheritDotParams nflreadr::load_rosters
Copy link
Member

Choose a reason for hiding this comment

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

This produces in a check warning

#' @inherit nflreadr::load_rosters
#' @seealso For information on parallel processing and progress updates please
#' see [nflfastR].
Expand All @@ -484,7 +483,6 @@ fast_scraper_roster <- function(...) nflreadr::load_rosters(...)

#' Load NFL Season Schedules
#' @details See [`nflreadr::load_schedules`] for details.
#' @inheritDotParams nflreadr::load_schedules
#' @inherit nflreadr::load_schedules
#' @seealso For information on parallel processing and progress updates please
#' see [nflfastR].
Expand Down
11 changes: 0 additions & 11 deletions man/fast_scraper_roster.Rd

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

7 changes: 0 additions & 7 deletions man/fast_scraper_schedules.Rd

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

41 changes: 0 additions & 41 deletions man/load_pbp.Rd

This file was deleted.

36 changes: 0 additions & 36 deletions man/load_player_stats.Rd

This file was deleted.

20 changes: 20 additions & 0 deletions man/reexports.Rd

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

52 changes: 0 additions & 52 deletions man/report.Rd

This file was deleted.

6 changes: 4 additions & 2 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ authors:
Samuel Ventura:
href: https://twitter.com/stat_sam
Tan Ho:
href: https://twitter.com/_TanHo
href: https://tanho.ca
John Edwards:
href: https://twitter.com/John_B_Edwards
home:
Expand Down Expand Up @@ -128,12 +128,14 @@ reference:
contents:
- load_pbp
- load_player_stats
- load_rosters
- load_schedules
- title: Utility Functions
contents:
- save_raw_pbp
- missing_raw_pbp
- starts_with("calculate_")
- report
- nflverse_sitrep
- title: Documentation
contents:
- nflfastR-package
Expand Down
Loading