Skip to contents

Data mapping teams to the stadiums they played regular season games in as the home team.

Usage

data(HomeGames)

Format

A data frame with 3233 observations on the following 9 variables.

year.key

Year

league.key

League; a factor with levels AA AL FL NL PL UA

team.key

Team; a factor

park.key

Unique identifier for each ballpark

span.first

First date the park began acting as home field for the team

span.last

Last date the park began acting as home field for the team

games

Total games in this time span

openings

Total opening in this time span

attendance

Total attendance in this time span

Source

Lahman, S. (2024) Lahman's Baseball Database, 1871-2023, 2024 version, http://www.seanlahman.com/

Examples

data(HomeGames)
library(dplyr)

# How many parks has every team played in as the home team for even a single game?
HomeGames %>%
  count(team.key) %>%
  arrange(team.key)
#>     team.key   n
#> 1        ALT   1
#> 2        ANA   8
#> 3        ARI  27
#> 4        ATL  59
#> 5        BAL  70
#> 6        BFN   9
#> 7        BFP   1
#> 8        BL1   3
#> 9        BL2   8
#> 10       BL3   3
#> 11       BL4   1
#> 12       BLA   2
#> 13       BLF   2
#> 14       BLN   8
#> 15       BLU   2
#> 16       BOS 129
#> 17       BR1   1
#> 18       BR2   4
#> 19       BR3  11
#> 20       BR4   3
#> 21       BRF   2
#> 22       BRO  71
#> 23       BRP   1
#> 24       BS1  11
#> 25       BS2   1
#> 26       BSN  84
#> 27       BSP   1
#> 28       BSU   1
#> 29       BUF   2
#> 30       CAL  32
#> 31       CH1   2
#> 32       CH2   2
#> 33       CHA 127
#> 34       CHF   2
#> 35       CHN 151
#> 36       CHP   1
#> 37       CHU   3
#> 38       CIN 137
#> 39       CL1   4
#> 40       CL2   6
#> 41       CL3   5
#> 42       CL4  20
#> 43       CL5   2
#> 44       CL6   3
#> 45       CLE 143
#> 46       CLP   1
#> 47       CN1   5
#> 48       CN2   9
#> 49       CN3   1
#> 50       CNU   1
#> 51       COL  31
#> 52       DET 128
#> 53       DTN   8
#> 54       ELI   2
#> 55       FLO  21
#> 56       FW1   1
#> 57       HAR   3
#> 58       HOU  64
#> 59       HR1   4
#> 60       IN1   3
#> 61       IN2   2
#> 62       IN3   3
#> 63       IND   1
#> 64       KC1  13
#> 65       KC2   3
#> 66       KCA  56
#> 67       KCF   2
#> 68       KCN   1
#> 69       KCU   1
#> 70       KEO   1
#> 71       LAA  24
#> 72       LAN  66
#> 73       LS1   2
#> 74       LS2  10
#> 75       LS3  10
#> 76       MIA  12
#> 77       MID   3
#> 78       MIL  26
#> 79       MIN  64
#> 80       ML1  13
#> 81       ML2   1
#> 82       ML3   2
#> 83       ML4  28
#> 84       MLA   1
#> 85       MLU   1
#> 86       MON  38
#> 87       NEW   1
#> 88       NH1   2
#> 89       NY1  81
#> 90       NY2   5
#> 91       NY3   1
#> 92       NY4   9
#> 93       NYA 124
#> 94       NYN  63
#> 95       NYP   1
#> 96       OAK  60
#> 97       PH1   7
#> 98       PH2   6
#> 99       PH3   1
#> 100      PH4  14
#> 101      PHA  54
#> 102      PHI 148
#> 103      PHN   1
#> 104      PHP   1
#> 105      PHU   1
#> 106      PIT 143
#> 107      PRO  10
#> 108      PT1   6
#> 109      PTF   2
#> 110      PTP   1
#> 111      RC1   2
#> 112      RC2   2
#> 113      RIC   1
#> 114      SDN  60
#> 115      SE1   1
#> 116      SEA  48
#> 117      SFN  66
#> 118      SL1   1
#> 119      SL2   1
#> 120      SL3   2
#> 121      SL4  10
#> 122      SL5   3
#> 123      SLA  52
#> 124      SLF   2
#> 125      SLN 136
#> 126      SLU   1
#> 127      SR1   1
#> 128      SR2   3
#> 129      TBA  30
#> 130      TEX  52
#> 131      TL1   2
#> 132      TL2   1
#> 133      TOR  51
#> 134      TRN   7
#> 135      TRO   3
#> 136      WAS  28
#> 137      WIL   1
#> 138      WOR   3
#> 139      WS1  60
#> 140      WS2  11
#> 141      WS3   5
#> 142      WS4   1
#> 143      WS5   1
#> 144      WS6   3
#> 145      WS7   1
#> 146      WS8   5
#> 147      WS9   1
#> 148      WSU   1

# What parks have the Toronto Blue Jays played in as the home team?
HomeGames %>%
  filter(team.key == "TOR") %>%
  arrange(span.last)
#>    year.key league.key team.key park.key span.first  span.last games openings
#> 1      1977         AL      TOR    TOR01 1977-04-07 1977-10-02    80       72
#> 2      1978         AL      TOR    TOR01 1978-04-14 1978-09-24    81       73
#> 3      1979         AL      TOR    TOR01 1979-04-13 1979-09-23    81       77
#> 4      1980         AL      TOR    TOR01 1980-04-16 1980-10-01    81       75
#> 5      1981         AL      TOR    TOR01 1981-04-13 1981-09-23    53       51
#> 6      1982         AL      TOR    TOR01 1982-04-09 1982-10-03    81       77
#> 7      1983         AL      TOR    TOR01 1983-04-09 1983-10-02    81       77
#> 8      1984         AL      TOR    TOR01 1984-04-17 1984-09-23    81       79
#> 9      1985         AL      TOR    TOR01 1985-04-16 1985-10-06    80       78
#> 10     1986         AL      TOR    TOR01 1986-04-14 1986-10-05    81       78
#> 11     1987         AL      TOR    TOR01 1987-04-06 1987-09-30    81       81
#> 12     1988         AL      TOR    TOR01 1988-04-11 1988-10-02    81       81
#> 13     1989         AL      TOR    TOR01 1989-04-14 1989-05-28    26       26
#> 14     1989         AL      TOR    TOR02 1989-06-05 1989-10-01    55       54
#> 15     1990         AL      TOR    TOR02 1990-04-10 1990-09-23    81       81
#> 16     1991         AL      TOR    TOR02 1991-04-08 1991-10-02    81       81
#> 17     1992         AL      TOR    TOR02 1992-04-10 1992-10-04    81       81
#> 18     1993         AL      TOR    TOR02 1993-04-09 1993-09-26    81       81
#> 19     1994         AL      TOR    TOR02 1994-04-04 1994-08-10    59       59
#> 20     1995         AL      TOR    TOR02 1995-04-26 1995-10-01    72       72
#> 21     1996         AL      TOR    TOR02 1996-04-09 1996-09-29    81       81
#> 22     1997         AL      TOR    TOR02 1997-04-01 1997-09-28    81       81
#> 23     1998         AL      TOR    TOR02 1998-04-01 1998-09-27    81       81
#> 24     1999         AL      TOR    TOR02 1999-04-12 1999-09-26    81       81
#> 25     2000         AL      TOR    TOR02 2000-04-03 2000-09-25    81       81
#> 26     2001         AL      TOR    SJU01 2001-04-01 2001-04-01     1        1
#> 27     2001         AL      TOR    TOR02 2001-04-09 2001-10-07    81       80
#> 28     2002         AL      TOR    TOR02 2002-04-04 2002-09-29    81       81
#> 29     2003         AL      TOR    TOR02 2003-03-31 2003-09-28    81       81
#> 30     2004         AL      TOR    TOR02 2004-04-05 2004-10-03    81       81
#> 31     2005         AL      TOR    TOR02 2005-04-08 2005-10-02    81       81
#> 32     2006         AL      TOR    TOR02 2006-04-04 2006-09-25    81       81
#> 33     2007         AL      TOR    TOR02 2007-04-09 2007-09-30    81       81
#> 34     2008         AL      TOR    TOR02 2008-04-04 2008-09-25    81       81
#> 35     2009         AL      TOR    TOR02 2009-04-06 2009-09-27    81       81
#> 36     2010         AL      TOR    TOR02 2010-04-12 2010-09-29    78       78
#> 37     2011         AL      TOR    TOR02 2011-04-01 2011-09-22    81       81
#> 38     2012         AL      TOR    TOR02 2012-04-09 2012-10-03    81       81
#> 39     2013         AL      TOR    TOR02 2013-04-02 2013-09-29    81       81
#> 40     2014         AL      TOR    TOR02 2014-04-04 2014-09-28    81       81
#> 41     2015         AL      TOR    TOR02 2015-04-13 2015-09-27    81       81
#> 42     2016         AL      TOR    TOR02 2016-04-08 2016-09-29    81       81
#> 43     2017         AL      TOR    TOR02 2017-04-11 2017-09-24    81       81
#> 44     2018         AL      TOR    TOR02 2018-03-29 2018-09-26    81       80
#> 45     2019         AL      TOR    TOR02 2019-03-28 2019-09-29    81       81
#> 46     2020         AL      TOR    BUF05 2020-08-11 2020-09-27    26        0
#> 47     2021         AL      TOR    DUN01 2021-04-08 2021-05-24    21       21
#> 48     2021         AL      TOR    BUF05 2021-06-01 2021-07-21    23       22
#> 49     2021         AL      TOR    TOR02 2021-07-30 2021-10-03    36       36
#> 50     2022         AL      TOR    TOR02 2022-04-08 2022-10-02    81       81
#> 51     2023         AL      TOR    TOR02 2023-04-11 2023-10-01    81       81
#>    attendance
#> 1     1700370
#> 2     1562509
#> 3     1431659
#> 4     1400327
#> 5      755083
#> 6     1275908
#> 7     1930277
#> 8     2110009
#> 9     2468925
#> 10    2455477
#> 11    2778459
#> 12    2595275
#> 13     748571
#> 14    2628122
#> 15    3884384
#> 16    4001526
#> 17    4028318
#> 18    4057747
#> 19    2907949
#> 20    2826445
#> 21    2559910
#> 22    2589317
#> 23    2454303
#> 24    2163486
#> 25    1819919
#> 26      19891
#> 27    1895236
#> 28    1638170
#> 29    1799818
#> 30    1900041
#> 31    2014995
#> 32    2302182
#> 33    2360648
#> 34    2399786
#> 35    1876129
#> 36    1495482
#> 37    1818103
#> 38    2099663
#> 39    2536562
#> 40    2375525
#> 41    2794891
#> 42    3392099
#> 43    3203886
#> 44    2325281
#> 45    1750144
#> 46          0
#> 47      30936
#> 48     170130
#> 49     604835
#> 50    2653830
#> 51    3021904
  
# What parks have the Boston Red Sox played in as the home team?
HomeGames %>%
  filter(team.key == "BOS") %>%
  arrange(span.last)
#>     year.key league.key team.key park.key span.first  span.last games openings
#> 1       1901         AL      BOS    BOS06 1901-05-08 1901-09-28    69       62
#> 2       1902         AL      BOS    BOS06 1902-04-19 1902-09-18    71       66
#> 3       1903         AL      BOS    BOS06 1903-04-20 1903-09-28    70       64
#> 4       1904         AL      BOS    BOS06 1904-04-18 1904-10-08    81       72
#> 5       1905         AL      BOS    BOS06 1905-04-21 1905-10-07    77       65
#> 6       1906         AL      BOS    BOS06 1906-04-17 1906-10-06    77       72
#> 7       1907         AL      BOS    BOS06 1907-04-16 1907-10-03    78       75
#> 8       1908         AL      BOS    BOS06 1908-04-14 1908-10-07    77       77
#> 9       1909         AL      BOS    BOS06 1909-04-21 1909-10-02    75       66
#> 10      1910         AL      BOS    BOS06 1910-04-19 1910-09-13    80       71
#> 11      1911         AL      BOS    BOS06 1911-04-21 1911-10-07    76       68
#> 12      1912         AL      BOS    BOS07 1912-04-20 1912-09-26    78       69
#> 13      1913         AL      BOS    BOS07 1913-04-10 1913-09-27    75       66
#> 14      1914         AL      BOS    BOS07 1914-04-14 1914-10-07    79       24
#> 15      1915         AL      BOS    BOS07 1915-04-22 1915-09-27    76       52
#> 16      1916         AL      BOS    BOS07 1916-04-12 1916-10-02    76       64
#> 17      1916         AL      BOS    BOS08 1916-10-03 1916-10-03     2        1
#> 18      1917         AL      BOS    BOS07 1917-04-21 1917-10-04    80       65
#> 19      1918         AL      BOS    BOS07 1918-04-15 1918-08-31    70       59
#> 20      1919         AL      BOS    BOS07 1919-05-01 1919-09-20    66       30
#> 21      1920         AL      BOS    BOS07 1920-04-15 1920-09-28    76       62
#> 22      1921         AL      BOS    BOS07 1921-04-21 1921-10-01    77       53
#> 23      1922         AL      BOS    BOS07 1922-04-12 1922-09-30    73       56
#> 24      1923         AL      BOS    BOS07 1923-04-26 1923-09-29    78       52
#> 25      1924         AL      BOS    BOS07 1924-04-15 1924-09-30    77       44
#> 26      1925         AL      BOS    BOS07 1925-04-22 1925-10-02    75       51
#> 27      1926         AL      BOS    BOS07 1926-04-13 1926-09-04    77       49
#> 28      1927         AL      BOS    BOS07 1927-04-21 1927-09-28    78       40
#> 29      1928         AL      BOS    BOS07 1928-04-11 1928-09-08    74       56
#> 30      1929         AL      BOS    BOS07 1929-04-23 1929-09-28    61       56
#> 31      1929         AL      BOS    BOS08 1929-04-28 1929-09-29    17       15
#> 32      1930         AL      BOS    BOS07 1930-04-15 1930-09-27    56       52
#> 33      1930         AL      BOS    BOS08 1930-04-19 1930-09-28    20       15
#> 34      1931         AL      BOS    BOS08 1931-05-31 1931-09-13    15       10
#> 35      1931         AL      BOS    BOS07 1931-04-22 1931-09-22    65       51
#> 36      1932         AL      BOS    BOS08 1932-04-19 1932-05-29     6        5
#> 37      1932         AL      BOS    BOS07 1932-04-13 1932-09-25    71       60
#> 38      1933         AL      BOS    BOS07 1933-04-21 1933-09-24    72       61
#> 39      1934         AL      BOS    BOS07 1934-04-17 1934-09-30    77       62
#> 40      1935         AL      BOS    BOS07 1935-04-23 1935-09-25    79       63
#> 41      1936         AL      BOS    BOS07 1936-04-14 1936-09-27    77       64
#> 42      1937         AL      BOS    BOS07 1937-04-24 1937-09-27    74       58
#> 43      1938         AL      BOS    BOS07 1938-04-18 1938-10-02    75       64
#> 44      1939         AL      BOS    BOS07 1939-04-21 1939-09-24    75       61
#> 45      1940         AL      BOS    BOS07 1940-04-19 1940-09-29    79       65
#> 46      1941         AL      BOS    BOS07 1941-04-15 1941-09-21    77       65
#> 47      1942         AL      BOS    BOS07 1942-04-14 1942-09-27    77       61
#> 48      1943         AL      BOS    BOS07 1943-04-27 1943-10-03    77       55
#> 49      1944         AL      BOS    BOS07 1944-04-18 1944-09-10    78       62
#> 50      1945         AL      BOS    BOS07 1945-04-20 1945-09-23    78       62
#> 51      1946         AL      BOS    BOS07 1946-04-20 1946-09-29    78       62
#> 52      1947         AL      BOS    BOS07 1947-04-15 1947-09-23    81       66
#> 53      1948         AL      BOS    BOS07 1948-04-19 1948-10-04    78       69
#> 54      1949         AL      BOS    BOS07 1949-04-22 1949-09-25    77       73
#> 55      1950         AL      BOS    BOS07 1950-04-18 1950-10-01    77       67
#> 56      1951         AL      BOS    BOS07 1951-04-20 1951-09-23    75       65
#> 57      1952         AL      BOS    BOS07 1952-04-18 1952-09-28    77       69
#> 58      1953         AL      BOS    BOS07 1953-04-20 1953-09-20    76       66
#> 59      1954         AL      BOS    BOS07 1954-04-15 1954-09-26    79       66
#> 60      1955         AL      BOS    BOS07 1955-04-14 1955-09-25    78       67
#> 61      1956         AL      BOS    BOS07 1956-04-17 1956-09-26    78       71
#> 62      1957         AL      BOS    BOS07 1957-04-18 1957-09-29    77       70
#> 63      1958         AL      BOS    BOS07 1958-04-15 1958-09-24    77       70
#> 64      1959         AL      BOS    BOS07 1959-04-14 1959-09-27    77       73
#> 65      1960         AL      BOS    BOS07 1960-04-19 1960-09-28    77       66
#> 66      1961         AL      BOS    BOS07 1961-04-11 1961-09-27    82       71
#> 67      1962         AL      BOS    BOS07 1962-04-10 1962-09-30    79       72
#> 68      1963         AL      BOS    BOS07 1963-04-16 1963-09-28    80       70
#> 69      1964         AL      BOS    BOS07 1964-04-17 1964-10-04    81       75
#> 70      1965         AL      BOS    BOS07 1965-04-17 1965-10-03    81       72
#> 71      1966         AL      BOS    BOS07 1966-04-12 1966-09-18    81       68
#> 72      1967         AL      BOS    BOS07 1967-04-12 1967-10-01    81       72
#> 73      1968         AL      BOS    BOS07 1968-04-16 1968-09-29    81       76
#> 74      1969         AL      BOS    BOS07 1969-04-14 1969-09-28    81       76
#> 75      1970         AL      BOS    BOS07 1970-04-14 1970-09-30    81       77
#> 76      1971         AL      BOS    BOS07 1971-04-06 1971-09-26    80       77
#> 77      1972         AL      BOS    BOS07 1972-04-17 1972-09-28    78       75
#> 78      1973         AL      BOS    BOS07 1973-04-06 1973-09-30    81       77
#> 79      1974         AL      BOS    BOS07 1974-04-11 1974-10-02    81       78
#> 80      1975         AL      BOS    BOS07 1975-04-08 1975-09-28    81       77
#> 81      1976         AL      BOS    BOS07 1976-04-13 1976-10-03    81       79
#> 82      1977         AL      BOS    BOS07 1977-04-07 1977-10-01    80       74
#> 83      1978         AL      BOS    BOS07 1978-04-14 1978-10-02    82       77
#> 84      1979         AL      BOS    BOS07 1979-04-05 1979-09-27    80       79
#> 85      1980         AL      BOS    BOS07 1980-04-14 1980-10-05    81       79
#> 86      1981         AL      BOS    BOS07 1981-04-10 1981-09-27    53       52
#> 87      1982         AL      BOS    BOS07 1982-04-12 1982-09-30    81       79
#> 88      1983         AL      BOS    BOS07 1983-04-05 1983-10-02    81       77
#> 89      1984         AL      BOS    BOS07 1984-04-13 1984-09-30    81       77
#> 90      1985         AL      BOS    BOS07 1985-04-08 1985-10-06    81       77
#> 91      1986         AL      BOS    BOS07 1986-04-14 1986-10-05    81       79
#> 92      1987         AL      BOS    BOS07 1987-04-10 1987-10-04    80       79
#> 93      1988         AL      BOS    BOS07 1988-04-04 1988-09-28    81       79
#> 94      1989         AL      BOS    BOS07 1989-04-10 1989-10-01    81       79
#> 95      1990         AL      BOS    BOS07 1990-04-09 1990-10-03    81       80
#> 96      1991         AL      BOS    BOS07 1991-04-11 1991-10-06    81       80
#> 97      1992         AL      BOS    BOS07 1992-04-13 1992-10-04    81       78
#> 98      1993         AL      BOS    BOS07 1993-04-13 1993-10-03    81       80
#> 99      1994         AL      BOS    BOS07 1994-04-04 1994-08-07    64       61
#> 100     1995         AL      BOS    BOS07 1995-04-26 1995-09-27    72       72
#> 101     1996         AL      BOS    BOS07 1996-04-09 1996-09-29    81       81
#> 102     1997         AL      BOS    BOS07 1997-04-11 1997-09-21    81       80
#> 103     1998         AL      BOS    BOS07 1998-04-10 1998-09-27    81       80
#> 104     1999         AL      BOS    BOS07 1999-04-13 1999-09-27    81       81
#> 105     2000         AL      BOS    BOS07 2000-04-11 2000-09-24    81       81
#> 106     2001         AL      BOS    BOS07 2001-04-06 2001-09-27    81       81
#> 107     2002         AL      BOS    BOS07 2002-04-01 2002-09-29    81       81
#> 108     2003         AL      BOS    BOS07 2003-04-12 2003-09-25    81       81
#> 109     2004         AL      BOS    BOS07 2004-04-09 2004-09-26    81       81
#> 110     2005         AL      BOS    BOS07 2005-04-11 2005-10-02    81       81
#> 111     2006         AL      BOS    BOS07 2006-04-11 2006-10-01    81       81
#> 112     2007         AL      BOS    BOS07 2007-04-10 2007-09-30    81       81
#> 113     2008         AL      BOS    BOS07 2008-04-08 2008-09-28    81       81
#> 114     2009         AL      BOS    BOS07 2009-04-07 2009-10-04    81       81
#> 115     2010         AL      BOS    BOS07 2010-04-04 2010-10-03    81       81
#> 116     2011         AL      BOS    BOS07 2011-04-08 2011-09-21    81       81
#> 117     2012         AL      BOS    BOS07 2012-04-13 2012-09-26    81       81
#> 118     2013         AL      BOS    BOS07 2013-04-08 2013-09-22    81       81
#> 119     2014         AL      BOS    BOS07 2014-04-04 2014-09-28    81       81
#> 120     2015         AL      BOS    BOS07 2015-04-13 2015-09-27    81       81
#> 121     2016         AL      BOS    BOS07 2016-04-11 2016-10-02    81       81
#> 122     2017         AL      BOS    BOS07 2017-04-03 2017-10-01    81       81
#> 123     2018         AL      BOS    BOS07 2018-04-05 2018-09-30    81       81
#> 124     2019         AL      BOS    LON01 2019-06-29 2019-06-30     2        2
#> 125     2019         AL      BOS    BOS07 2019-04-09 2019-09-29    79       79
#> 126     2020         AL      BOS    BOS07 2020-07-24 2020-09-24    31        0
#> 127     2021         AL      BOS    BOS07 2021-04-02 2021-09-26    81       81
#> 128     2022         AL      BOS    BOS07 2022-04-15 2022-10-05    81       81
#> 129     2023         AL      BOS    BOS07 2023-03-30 2023-09-27    81       81
#>     attendance
#> 1       286974
#> 2       338894
#> 3       373297
#> 4       629247
#> 5       479306
#> 6       407458
#> 7       456120
#> 8       543686
#> 9       705628
#> 10      714594
#> 11      597928
#> 12      708050
#> 13      490600
#> 14      216602
#> 15      500679
#> 16      534320
#> 17        4800
#> 18      473633
#> 19      309944
#> 20      360550
#> 21      425694
#> 22      301500
#> 23      306000
#> 24      285700
#> 25      435500
#> 26      245000
#> 27      280161
#> 28      263500
#> 29      404970
#> 30      281350
#> 31      209500
#> 32      324000
#> 33      227200
#> 34      145128
#> 35      298318
#> 36       34000
#> 37      209400
#> 38      356573
#> 39      764495
#> 40      695827
#> 41      728196
#> 42      595108
#> 43      695700
#> 44      585800
#> 45      721200
#> 46      771562
#> 47      781395
#> 48      396937
#> 49      541118
#> 50      623085
#> 51     1412141
#> 52     1427061
#> 53     1552246
#> 54     1595952
#> 55     1344177
#> 56     1311663
#> 57     1115741
#> 58     1026914
#> 59      932293
#> 60     1202885
#> 61     1137658
#> 62     1181184
#> 63     1083850
#> 64      990103
#> 65     1129765
#> 66      850856
#> 67      723710
#> 68      942729
#> 69      883279
#> 70      651761
#> 71      815197
#> 72     1694362
#> 73     1882655
#> 74     1837449
#> 75     1594593
#> 76     1682829
#> 77     1434336
#> 78     1483301
#> 79     1558391
#> 80     1748518
#> 81     1895885
#> 82     2074549
#> 83     2320210
#> 84     2353125
#> 85     1956110
#> 86     1060659
#> 87     1954038
#> 88     1780794
#> 89     1660551
#> 90     1786463
#> 91     2146694
#> 92     2231649
#> 93     2463339
#> 94     2512069
#> 95     2512898
#> 96     2562356
#> 97     2469489
#> 98     2422054
#> 99     1775541
#> 100    2164401
#> 101    2315349
#> 102    2223602
#> 103    2343930
#> 104    2446277
#> 105    2585895
#> 106    2625333
#> 107    2650859
#> 108    2724165
#> 109    2837304
#> 110    2847798
#> 111    2930768
#> 112    2970755
#> 113    3048250
#> 114    3062699
#> 115    3046445
#> 116    3054001
#> 117    3043003
#> 118    2833333
#> 119    2956089
#> 120    2880694
#> 121    2955434
#> 122    2917678
#> 123    2895575
#> 124     118718
#> 125    2796784
#> 126          0
#> 127    1725323
#> 128    2625089
#> 129    2672130
  
# What is the Toronto Blue Jays annual total home attendance by year?
HomeGames %>%
  filter(team.key == "TOR") %>%
  group_by(year.key) %>%
  summarize(total.attendance = sum(attendance)) %>%
  arrange(year.key)
#> # A tibble: 47 × 2
#>    year.key total.attendance
#>       <int>            <int>
#>  1     1977          1700370
#>  2     1978          1562509
#>  3     1979          1431659
#>  4     1980          1400327
#>  5     1981           755083
#>  6     1982          1275908
#>  7     1983          1930277
#>  8     1984          2110009
#>  9     1985          2468925
#> 10     1986          2455477
#> # ℹ 37 more rows