Skip to contents

This function transforms the city frequency data by adding a log-transformed show count and categorizing cities based on their show counts using custom breaks.

Usage

transform_city_frequency(city_frequency, breaks)

Arguments

city_frequency

A data frame containing city frequency information, including a 'show_count' column.

breaks

A numeric vector of break points for categorizing show counts.

Value

A data frame with additional columns for log-transformed show counts and show count categories.

Examples

city_frequency <- data.frame(
  city = c("New York", "London", "Paris", "Berlin"),
  country = c("USA", "UK", "France", "Germany"),
  show_count = c(50, 25, 10, 1)
)
breaks <- c(0, 1, 5, 10, 25, 50, 100, Inf)
transformed_data <- transform_city_frequency(city_frequency, breaks)