Skip to contents

Computes the frequency of each song played across different tours and includes additional tour statistics.

Usage

calculate_song_frequency_across_tours(data, tour_stats, tour_order = NULL)

Arguments

data

A data frame in concertData format, containing at least 'tour', 'song_title', and 'showID' columns.

tour_stats

A data frame containing tour statistics, including 'tour', 'total_shows', 'avg_songs_per_show', 'overall_variability', 'total_unique_snippets', and 'total_unique_songs' columns.

tour_order

A data frame with a 'tour' column specifying the desired order of tours (optional).

Value

A data frame with columns:

  • tour: Name of the tour (as a factor)

  • song_title: Title of the song

  • song_count: Number of shows in which the song was played

  • avg_songs_per_show: Average number of songs per show for the tour

  • overall_variability: Overall variability metric for the tour

  • total_shows: Total number of shows in the tour

  • total_unique_snippets: Total number of unique snippets in the tour

  • total_unique_songs: Total number of unique songs in the tour

  • song_frequency: Proportion of shows in which the song was played

Examples

if (FALSE) { # \dontrun{
song_freq <- calculate_song_frequency_across_tours(concert_data, tour_statistics, tour_order)
} # }