dp_clean_names: Clean Player Names

View source: R/z_deprecated.R

dp_clean_namesR Documentation

Clean Player Names

Description

Applies some name-cleaning heuristics to facilitate joins. These heuristics may include:

  • removing periods and apostrophes

  • removing common suffixes, such as Jr, Sr, II, III, IV

  • converting to lowercase

  • using ffscrapr::dp_name_mapping to do common name substitutions, such as Mitch Trubisky to Mitchell Trubisky

Usage

dp_clean_names(...)

dp_cleannames(...)

Arguments

...

Arguments passed on to nflreadr::clean_player_names

player_name

a character vector of player names

lowercase

defaults to FALSE - if TRUE, converts to lowercase

convert_lastfirst

defaults to TRUE - converts names from "Last, First" to "First Last"

use_name_database

uses internal name database to do common substitutions (Mitchell Trubisky to Mitch Trubisky etc)

Details

Equivalent to the operation done by ffscrapr::dp_clean_names() and uses the same player name database.

Value

a character vector of cleaned names

See Also

nflreadr::clean_player_names()

Examples



dp_cleannames(c("A.J. Green", "Odell Beckham Jr.", "Le'Veon Bell Sr."))

dp_cleannames(c("Trubisky, Mitch", "Atwell, Chatarius", "Elliott, Zeke", "Elijah Moore"),
  convert_lastfirst = TRUE,
  use_name_database = TRUE
)


dynastyprocess/ffscrapr documentation built on June 4, 2024, 1 p.m.