sentimentr
sentimentr copied to clipboard
plot.sentiment_by ordered fix?
Great package! I appreciate your work on this.
When plotting a sentiment_by result, I noticed that it always orders groups by the median sentiment regardless of if I set the ordered parameter TRUE or FALSE.
I looked at the code for the plotting plot.sentiment_by on github and it doesn't seem like the ordered parameter is used.
I'm not sure, but I suggest this as potential fix in that function:
if (ordered==TRUE) {
x[, grouping.vars := factor(grouping.vars, levels = rev(grouping.vars))]
} else {
x[, grouping.vars := factor(grouping.vars)]
}
Best, Edmund