generate_substitution_row: generate a row of substitution data for a pbp data.frame....

generate_substitution_rowR Documentation

generate a row of substitution data for a pbp data.frame. This can be dput into fix pbp to add a missing row

Description

generate a row of substitution data for a pbp data.frame. This can be dput into fix pbp to add a missing row

Usage

generate_substitution_row(
  player_in_id,
  player_out_id,
  player_data,
  quarter,
  elapsed_time_in_quarter
)

Arguments

player_in_id

the id of the player entering the game

player_out_id

the id of the player leaving the game

player_data

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

quarter

the quarter in which the substitution should occur

elapsed_time_in_quarter

number of seconds since the start of the quarter when the sub should be inserted

Value

a one row data.frame with substitution data. This can be inserted into a pbp data.frame

See Also

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


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