Skip to contents

String parsing helper to cleanup player names for continuity.

Usage

replace_player_names(df, player_col = "player")

Arguments

df

Dataframe with player column to clean up names

Value

Dataframe with cleaned up player names

Details

The function replace_player_names reads a dataframe that includes player names and uses str_replace to clean up names. This can be used across the package when joining data such that all player names are the same. The function strips names of suffixes like Jr., Sr., II, III. Also, the first names that are abbreviations like D.J. Moore and D.K. Metcalf have the periods stripped from the initials. All other player names are specified to say the same. Some specific cases are defined explicitly.

Author

Nolan MacDonald