| Parks | R Documentation |
Name and location data for baseball stadiums.
data(Parks)
A data frame with 260 observations on the following 6 variables.
park.keyunique identifier for each ballpark
park.namethe name of the ballpark
park.aliasa semicolon delimited list of other names for the ballpark if they exist
citycity where the ballpark is located
statestate where the ballpark is located
countrycountry where the ballpark is located
This dataset apparently includes all ballparks that were ever used in baseball. There is no indication of the years they were used, nor the teams that played there.
The ballparks can be associated with teams through the park variable in the
Teams table.
Lahman, S. (2024) Lahman's Baseball Database, 1871-2023, 2023 version, http://www.seanlahman.com/
Teams
data(Parks)
library(dplyr)
# how many parks in each country?
table(Parks$country)
# how many parks in each US state?
Parks %>%
filter(country=="US") %>%
count(state, sort=TRUE)
# ballparks in NYC
Parks %>%
filter(state=="NY") %>%
filter(city %in% c("New York", "Brooklyn", "Queens"))
# ballparks in Canada
Parks %>%
filter(country=="CA") %>%
count(state, sort=TRUE)
# what are the Canadian parks?
Parks %>%
dplyr::filter(country=="CA")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.