dp_cleannames: Clean Names

Description Usage Arguments Value See Also Examples

View source: R/1_import_dp.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dp_cleannames(
  player_name,
  lowercase = FALSE,
  convert_lastfirst = TRUE,
  use_name_database = TRUE
)

dp_clean_names(
  player_name,
  lowercase = FALSE,
  convert_lastfirst = TRUE,
  use_name_database = TRUE
)

Arguments

player_name

a character (or character vector)

lowercase

defaults to FALSE - if TRUE, converts to lowercase

convert_lastfirst

converts names from "Last, First" to "First Last" (i.e. MFL style)

use_name_database

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

Value

a character vector of cleaned names

See Also

dp_name_mapping

Examples

1
2
3
4
5
6
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
)

ffscrapr documentation built on Nov. 10, 2021, 9:09 a.m.