Skip to contents

This function creates frequency counts for cities based on unique shows and joins the result with geocoded city data.

Usage

create_city_frequency(unique_shows, geocoded_cities)

Arguments

unique_shows

A data frame containing unique show information.

geocoded_cities

A data frame containing geocoded city information.

Value

A data frame with city frequency counts and geocoded information.

Examples

unique_shows <- data.frame(
  showID = 1:3,
  city = c("New York", "London", "New York"),
  country = c("USA", "UK", "USA"),
  date = as.Date(c("2023-01-01", "2023-02-01", "2023-03-01")),
  venue = c("Madison Square Garden", "Wembley Stadium", "Yankee Stadium"),
  tour = c("Tour A", "Tour B", "Tour A")
)
geocoded_cities <- data.frame(
  city = c("New York", "London"),
  country = c("USA", "UK"),
  lat = c(40.7128, 51.5074),
  lon = c(-74.0060, -0.1278)
)
city_freq <- create_city_frequency(unique_shows, geocoded_cities)