diff --git a/NAMESPACE b/NAMESPACE index ddb2bfd..9427a20 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,11 +2,14 @@ export(.basis_release_raw_roster) export(.draft_release_season) +export(.espn_combine_raw_players) +export(.espn_release_raw_players) export(.pff_release_raw_players) export(players_basis_release) export(players_build_dataset) export(players_download) export(players_draft_release) +export(players_espn_release) export(players_fetch_manual_ids) export(players_manual_overwrite) export(players_otc_release) diff --git a/man/dot-espn_combine_raw_players.Rd b/man/dot-espn_combine_raw_players.Rd new file mode 100644 index 0000000..3fbe45f --- /dev/null +++ b/man/dot-espn_combine_raw_players.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/players_espn.R +\name{.espn_combine_raw_players} +\alias{.espn_combine_raw_players} +\title{Combine Raw ESPN Player Files} +\usage{ +.espn_combine_raw_players(overwrite = !interactive()) +} +\arguments{ +\item{overwrite}{If \code{TRUE} overwrites all existing raw ESPN files in the +directory \code{./build/raw_espn}.} +} +\value{ +Returns the combined raw players ESPN dataset invisibly +} +\description{ +This function downloads raw ESPN player files from the release tag \code{raw_espn} +in the nflverse-players repo, and summarizes the data (uses the latest season +of each player) to the raw players ESPN dataset. Raw players data are saved +locally. Set argument \code{overwrite} to \code{TRUE} to always download the latest data. +The function finishes by releasing the raw players ESPN data to the release tag +\code{raw_espn} of the nflverse-players repo. +} diff --git a/man/dot-espn_release_raw_players.Rd b/man/dot-espn_release_raw_players.Rd new file mode 100644 index 0000000..6f45d78 --- /dev/null +++ b/man/dot-espn_release_raw_players.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/players_espn.R +\name{.espn_release_raw_players} +\alias{.espn_release_raw_players} +\title{Release ESPN Players Files} +\usage{ +.espn_release_raw_players(seasons) +} +\arguments{ +\item{seasons}{The seasons for which to release ESPN players files} +} +\description{ +This function releases raw ESPN players files to a release in the nflverse-players +repo. This function is intended to update the most recent season in order +to get up to date ESPN player information. +} diff --git a/man/players_download.Rd b/man/players_download.Rd index 53351c6..2cadb87 100644 --- a/man/players_download.Rd +++ b/man/players_download.Rd @@ -4,10 +4,12 @@ \alias{players_download} \title{Download Players Components} \usage{ -players_download(type = c("basis", "pfr", "otc", "pff", "draft", "full")) +players_download( + type = c("basis", "pfr", "otc", "pff", "espn", "draft", "full") +) } \arguments{ -\item{type}{One of \code{"basis"}, \code{"pfr"}, \code{"pff"}, \code{"otc"}, \code{"full"}} +\item{type}{One of \code{"basis"}, \code{"pfr"}, \code{"pff"}, \code{"otc"}, \code{"espn"}, \code{"draft"}, \code{"full"}} } \value{ A dataframe with players data diff --git a/man/players_espn_release.Rd b/man/players_espn_release.Rd new file mode 100644 index 0000000..9bcb77a --- /dev/null +++ b/man/players_espn_release.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/players_espn.R +\name{players_espn_release} +\alias{players_espn_release} +\title{Release Players ESPN ID Mapping} +\usage{ +players_espn_release( + players_espn_full_rebuild = Sys.getenv("PLAYERS_ESPN_REBUILD", "false") +) +} +\arguments{ +\item{players_espn_full_rebuild}{If \code{FALSE} (the default), the function will +load the players dataset using \code{players_download("full")} and fill only missing +ESPN IDs. Otherwise, it will fill ESPN IDs of all players. Set the environment +variable \code{"PLAYERS_ESPN_REBUILD"} to control the behavior.} +} +\value{ +Returns the players ESPN dataset invisibly +} +\description{ +This function loads ESPN player IDs and the players basis dataset +(see \link{players_basis_release}) and tries to join as many ESPN IDs as possible. +Currently the function tries to join by +\itemize{ +\item{Full name and position} +\item{Full name} +} +Joining is done in the order given and the function cleans the names prior +to joins with \code{\link[nflreadr:clean_player_names]{nflreadr::clean_player_names()}}. +The function finishes by releasing a ESPN ID to GSIS ID mapping to the release +tag \code{players_components} of the nflverse-players repo. +} +\details{ +The underlying join function prints messages of join status. You can suppress +the messages by setting \code{options(players_espn_join.verbose = FALSE)}. +} diff --git a/man/players_validate.Rd b/man/players_validate.Rd index 2b33391..ffb4b4c 100644 --- a/man/players_validate.Rd +++ b/man/players_validate.Rd @@ -8,7 +8,7 @@ players_validate(data, verbose = FALSE) } \arguments{ \item{data}{A data frame, tibble, or data.table consisting of player IDs. -The variable names must be one of gsis_id, pfr_id, pff_id, and otc_id.} +The variable names must be one of gsis_id, pfr_id, pff_id, otc_id, and espn_id.} \item{verbose}{If \code{TRUE}, will print success messages and a summary.} } @@ -18,7 +18,7 @@ Returns \code{data}. duplicated observations will be attached in attributes. \description{ Search for duplicated player IDs in a table and attach them to the input data. The function automatically loops over the player ID variable names -gsis_id, pfr_id, pff_id, and otc_id and searches for duplicated IDs in each +gsis_id, pfr_id, pff_id, otc_id, and espn_id and searches for duplicated IDs in each of these variables. } \seealso{ diff --git a/man/players_validate_extract_duplicated.Rd b/man/players_validate_extract_duplicated.Rd index ab4314d..e8d4237 100644 --- a/man/players_validate_extract_duplicated.Rd +++ b/man/players_validate_extract_duplicated.Rd @@ -10,7 +10,7 @@ players_validate_extract_duplicated(data, id = relevant_ids()) \item{data}{A data frame that was checked with \link{players_validate}} \item{id}{ID to extract a table of duplicates. Must be one of -gsis_id, pfr_id, pff_id, and otc_id} +gsis_id, pfr_id, pff_id, otc_id, and espn_id} } \value{ A table of duplicated IDs, sorted by value of \code{id}