Skip to contents

Retrieve Homerun Derby data

Usage

mlb_homerun_derby(game_pk)

Arguments

game_pk

The game_pk for which you want to return data

Value

Returns a tibble with the following columns

col_nametypes
game_pkinteger
event_namecharacter
event_datecharacter
event_type_codecharacter
event_type_namecharacter
venue_idinteger
venue_namecharacter
roundinteger
num_battersinteger
battercharacter
batter_idinteger
batter_linkcharacter
top_seed_startedlogical
top_seed_completelogical
top_seed_winnerlogical
bonus_timelogical
home_runlogical
tie_breakerlogical
is_home_runlogical
time_remainingcharacter
is_bonus_timelogical
is_tie_breakerlogical
hit_data_launch_speedinteger
hit_data_launch_angleinteger
hit_data_total_distanceinteger
hit_data_coordinates_coord_xnumeric
hit_data_coordinates_coord_ynumeric
hit_data_coordinates_landing_pos_xnumeric
hit_data_coordinates_landing_pos_ynumeric
hit_data_trajectory_data_trajectory_polynomial_xlist
hit_data_trajectory_data_trajectory_polynomial_ylist
hit_data_trajectory_data_trajectory_polynomial_zlist
hit_data_trajectory_data_valid_time_intervallist
top_seed_seedinteger
top_seed_is_winnerlogical
top_seed_is_completelogical
top_seed_is_startedlogical
top_seed_num_home_runsinteger
top_seed_player_idinteger
top_seed_player_full_namecharacter
top_seed_player_linkcharacter
top_seed_top_derby_hit_data_launch_speedinteger
top_seed_top_derby_hit_data_total_distanceinteger
bottom_seed_startedlogical
bottom_seed_completelogical
bottom_seed_winnerlogical
bottom_seed_seedinteger
bottom_seed_is_winnerlogical
bottom_seed_is_completelogical
bottom_seed_is_startedlogical
bottom_seed_num_home_runsinteger
bottom_seed_player_idinteger
bottom_seed_player_full_namecharacter
bottom_seed_player_linkcharacter
bottom_seed_top_derby_hit_data_launch_speedinteger
bottom_seed_top_derby_hit_data_total_distanceinteger
venue_linkcharacter
is_multi_daylogical
is_primary_calendarlogical
file_codecharacter
event_numberinteger
public_facinglogical

Examples

# \donttest{
  try(mlb_homerun_derby(game_pk = 511101))
#> ── MLB Homerun Derby data from MLB.com ────────────── baseballr 1.2.0 ──
#>  Data updated: 2022-04-30 07:16:10 UTC
#> # A tibble: 396 × 62
#>    game_pk event_name         event_date event_type_code event_type_name
#>      <int> <chr>              <chr>      <chr>           <chr>          
#>  1  511101 All-Star Workout … 2017-07-1… O               Other          
#>  2  511101 All-Star Workout … 2017-07-1… O               Other          
#>  3  511101 All-Star Workout … 2017-07-1… O               Other          
#>  4  511101 All-Star Workout … 2017-07-1… O               Other          
#>  5  511101 All-Star Workout … 2017-07-1… O               Other          
#>  6  511101 All-Star Workout … 2017-07-1… O               Other          
#>  7  511101 All-Star Workout … 2017-07-1… O               Other          
#>  8  511101 All-Star Workout … 2017-07-1… O               Other          
#>  9  511101 All-Star Workout … 2017-07-1… O               Other          
#> 10  511101 All-Star Workout … 2017-07-1… O               Other          
#> # … with 386 more rows, and 57 more variables: venue_id <int>,
#> #   venue_name <chr>, round <int>, num_batters <int>, batter <chr>,
#> #   batter_id <int>, batter_link <chr>, top_seed_complete <lgl>,
#> #   top_seed_started <lgl>, top_seed_winner <lgl>, bonus_time <lgl>,
#> #   home_run <lgl>, tie_breaker <lgl>, is_home_run <lgl>,
#> #   time_remaining <chr>, is_bonus_time <lgl>, is_tie_breaker <lgl>,
#> #   hit_data_launch_speed <int>, hit_data_launch_angle <int>, …
# }