Performs an analysis of song positions within setlists across different tours.
Arguments
- data
A data frame in concertData format, containing at least 'tour', 'showID', 'song_title', and 'song_position' columns.
- max_songs_by_tour
A data frame with 'tour' and 'max_songs' columns, typically output from longest_setlist_by_tour function.
- 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 if tour_order is provided)
position_bin: The song position in the setlist
unique_songs: Number of unique songs played in this position
total_occurrences: Total number of songs played in this position
most_common_song: The most frequently played song in this position
most_common_freq: Frequency of the most common song
predictability: Ratio of most_common_freq to total_occurrences
variability: 1 - predictability
Examples
if (FALSE) { # \dontrun{
max_songs <- longest_setlist_by_tour(concert_data)
tour_order <- tour_order_date(concert_data)
position_analysis <- analyze_song_positions(concert_data, max_songs, tour_order)
} # }