Skip to contents

Produces a summary table that includes song performance counts, song performance intensities, and ratings based on the estimated choice model parameters.

Usage

Repeatr_5(
  mymodeldf = NULL,
  mysongidlookup = NULL,
  myaltlookup = NULL,
  myfugazi_song_performance_intensity = NULL,
  mysongvarslookup = NULL,
  myreleasesdatalookup = NULL,
  myreleases_data_input = NULL,
  input_dir = NULL,
  output_dir = NULL
)

Arguments

mymodeldf

optional choice model coefficients dataframe to be used to generate the results. If omitted, the default choice model coefficients dataframe will be used, which is results_ml_Repeatr4.

mysongidlookup

optional songidlookup dataframe (the songidlookup element of Repeatr_1()'s return list). If omitted the currently lazy-loaded default will be used.

myaltlookup

optional altlookup dataframe (the second element of Repeatr_2()'s return list) used to translate mymodeldf's alt-indexed intercept coefficients back to songid/title. If omitted the currently lazy-loaded default will be used.

myfugazi_song_performance_intensity

optional fugazi_song_performance_intensity dataframe (the third element of Repeatr_2()'s return list). If omitted the currently lazy-loaded default will be used - pass this explicitly when calling Repeatr_5() right after a fresh Repeatr_2() in the same session, since the lazy-loaded default reflects the last build on disk, not the one just computed.

mysongvarslookup

optional songvarslookup dataframe (the songvarslookup element of Repeatr_1()'s return list). If omitted the currently lazy-loaded default will be used.

myreleasesdatalookup

optional releasesdatalookup dataframe (the releasesdatalookup element of Repeatr_1()'s return list). If omitted the currently lazy-loaded default will be used.

myreleases_data_input

optional releases_data_input dataframe (the releases_data_input element of Repeatr_1()'s return list). If omitted the currently lazy-loaded default will be used.

input_dir

Optional directory to write the fugazi_song_choice_model.csv/fugazi_song_preferences.csv/releases_rated.csv/summary.csv output-export CSVs into. If omitted, defaults to this package's own inst/extdata (these are Repeatr's own downloadable outputs, not primary/raw data).

output_dir

Optional directory to save the rebuilt data/*.rda objects into. If omitted, defaults to data/ under the current working directory.

Value

A list of 5 elements: fugazi_song_choice_model (per-variable coefficient table with song names substituted in for the intercept terms), fugazi_song_preferences (songs ranked by estimated preference), summary (song performance summary combining counts, intensity and rating), releases_rated (average rating by release), and releases_data_input (per-song-per-release data enriched with the estimated rating). Each of these, plus releases_summary, is also saved into data/.

Examples

Repeatr_5_results <- Repeatr_5(mymodeldf = results_ml_Repeatr4,
                                output_dir = tempdir(), input_dir = tempdir())
#> Joining with `by = join_by(alt)`
#> Joining with `by = join_by(alt)`
#> Joining with `by = join_by(songid)`
#> Joining with `by = join_by(title)`
#> Joining with `by = join_by(track_number, title)`
#> Joining with `by = join_by(rid)`
#> Joining with `by = join_by(rid)`
#> Joining with `by = join_by(title)`
#> Joining with `by = join_by(songid, title)`
#> Joining with `by = join_by(rid)`
#> Joining with `by = join_by(rid, track_number, rating)`
#> Joining with `by = join_by(rid)`