mlb_attendance function

MLB Attendance

MLB Attendance

mlb_attendance( team_id = NULL, league_id = NULL, season = NULL, date = NULL, league_list_id = NULL )

Arguments

  • team_id: Return attendance information for a particular team_id(s).

  • league_id: Return attendance information for a particular league_id(s). Format: '103,104'

  • season: Return attendance information for particular year(s).

  • date: Return attendance information on a particular date. Format: MM/DD/YYYY

  • league_list_id: Unique league list identifier to return a directory of attendance for a specific league list_id Valid values include:

    • milb_full
    • milb_short
    • milb_complex
    • milb_all
    • milb_all_nomex
    • milb_all_domestic
    • milb_noncomp
    • milb_noncomp_nomex
    • milb_domcomp
    • milb_intcomp
    • win_noabl
    • win_caribbean
    • win_all
    • abl
    • mlb
    • mlb_hist
    • mlb_milb
    • mlb_milb_hist
    • mlb_milb_win
    • baseball_all

Returns

Returns a tibble with the following columns

col_nametypes
openings_totalinteger
openings_total_awayinteger
openings_total_homeinteger
openings_total_lostinteger
games_totalinteger
games_away_totalinteger
games_home_totalinteger
yearcharacter
attendance_average_awayinteger
attendance_average_homeinteger
attendance_average_ytdinteger
attendance_highinteger
attendance_high_datecharacter
attendance_lowinteger
attendance_low_datecharacter
attendance_opening_averageinteger
attendance_totalinteger
attendance_total_awayinteger
attendance_total_homeinteger
attendance_high_game_game_pkinteger
attendance_high_game_linkcharacter
attendance_high_game_day_nightcharacter
attendance_high_game_content_linkcharacter
attendance_low_game_game_pkinteger
attendance_low_game_linkcharacter
attendance_low_game_day_nightcharacter
attendance_low_game_content_linkcharacter
game_type_idcharacter
game_type_descriptioncharacter
team_idinteger
team_namecharacter
team_linkcharacter

Examples

try(mlb_attendance(team_id = 109, season = 2021))