Skip to contents

This function creates a decade-based frequency count of shows for each city, and joins this information with geocoded city data.

Usage

create_decade_frequency(unique_shows, geocoded_cities)

Arguments

unique_shows

A data frame containing unique show information, including 'showID', 'city', 'country', and 'date' columns.

geocoded_cities

A data frame containing geocoded information for cities.

Value

A data frame with decade-based show counts for each city, including geocoded information.

Examples

unique_shows <- data.frame(
  showID = 1:5,
  city = c("New York", "London", "Paris", "New York", "Tokyo"),
  country = c("USA", "UK", "France", "USA", "Japan"),
  date = as.Date(c("1990-01-01", "2000-01-01", "2010-01-01", "1995-01-01", "2020-01-01"))
)
geocoded_cities <- data.frame(
  city = c("New York", "London", "Paris", "Tokyo"),
  country = c("USA", "UK", "France", "Japan"),
  lat = c(40.7128, 51.5074, 48.8566, 35.6762),
  lon = c(-74.0060, -0.1278, 2.3522, 139.6503)
)
decade_frequency <- create_decade_frequency(unique_shows, geocoded_cities)