Takes a dataframe which includes valence scores and compares the levels of a specified factor.
valence_compare(
valence_df,
compare_factor,
ordered = TRUE
)
A dataframe with a valence score variable called 'ave_sentiment', e.g. output of ParseR::valence_overview().
The factor whose levels should be compared
Logical argument indicating whether to order plots by mean sentiment.
A list containing a summary table, a bar chart, and a ridgeplot.
comparisons <- valence_compare(valence_df, message_type)
#> Joining, by = "message_type"
#Summary table
comparisons$summary
#> # A tibble: 2 × 4
#> message_type mean lower_ci upper_ci
#> <fct> <dbl> <dbl> <dbl>
#> 1 Twitter Update 0.169 0.162 0.176
#> 2 Twitter Mention 0.181 0.172 0.190
#Visualise distributions in Ridgeplots
comparisons$distributions
#> Picking joint bandwidth of 0.0336