produces results using a coefficient table for a choice model estimated with mlogit.
Source:R/Repeatr_5.R
Repeatr_5.RdProduces 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
songidlookupdataframe (thesongidlookupelement ofRepeatr_1()'s return list). If omitted the currently lazy-loaded default will be used.- myaltlookup
optional
altlookupdataframe (the second element ofRepeatr_2()'s return list) used to translatemymodeldf'salt-indexed intercept coefficients back tosongid/title. If omitted the currently lazy-loaded default will be used.- myfugazi_song_performance_intensity
optional
fugazi_song_performance_intensitydataframe (the third element ofRepeatr_2()'s return list). If omitted the currently lazy-loaded default will be used - pass this explicitly when callingRepeatr_5()right after a freshRepeatr_2()in the same session, since the lazy-loaded default reflects the last build on disk, not the one just computed.- mysongvarslookup
optional
songvarslookupdataframe (thesongvarslookupelement ofRepeatr_1()'s return list). If omitted the currently lazy-loaded default will be used.- myreleasesdatalookup
optional
releasesdatalookupdataframe (thereleasesdatalookupelement ofRepeatr_1()'s return list). If omitted the currently lazy-loaded default will be used.- myreleases_data_input
optional
releases_data_inputdataframe (thereleases_data_inputelement ofRepeatr_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.csvoutput-export CSVs into. If omitted, defaults to this package's owninst/extdata(these are Repeatr's own downloadable outputs, not primary/raw data).- output_dir
Optional directory to save the rebuilt
data/*.rdaobjects into. If omitted, defaults todata/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)`