Skip to contents

This function calculates and returns the most frequently played songs from a dataset, including total plays, regular plays, and snippet plays.

Usage

find_most_played_songs(concert_data, n = 10)

Arguments

n

An integer specifying the number of top played songs to return. Default is 10.

data

A concertData data frame containing song play data.

Value

A data frame with four columns: song_title, times_played_total, times_played_regular, times_played_snippet, sorted in descending order by times_played_total.

Examples

if (FALSE) { # \dontrun{
top_songs <- find_most_played_songs(concert_data)
top_songs <- find_most_played_songs(concert_data, n = 5)
} # }