get_player_ids_from_desc: Given a sentence of data from ESPN play by play about a...

get_player_ids_from_descR Documentation

Given a sentence of data from ESPN play by play about a substituon, return the player ids of the entering and exiting player. Note that this function only works when the players have a single first and last name (e.g. Julius Randle, but not J.R. Barrett)

Description

Given a sentence of data from ESPN play by play about a substituon, return the player ids of the entering and exiting player. Note that this function only works when the players have a single first and last name (e.g. Julius Randle, but not J.R. Barrett)

Usage

get_player_ids_from_desc(sen, player_data)

Arguments

sen

the text indicating the substition (e.g."Mitchell Robinson enters the game for Julius Randle")

player_data

a data.frame of player data, as returned by get_player_data()$api_json$players

Value

a length two list with names "pi_id" and "po_id" giving the msf player ids of the two players involved in the substitution

See Also

Other audit_functions: generate_substitution_row_from_desc(), generate_substitution_row(), read_boxscore_screen_shot(), remove_pbp()


kburnham/tidynbadata documentation built on Aug. 7, 2024, 12:10 a.m.