larmarange / ggstats

Extension to ggplot2 for plotting stats
https://larmarange.github.io/ggstats/
GNU General Public License v3.0
26 stars 1 forks source link

gglikert: Is it possible to tell which items are "bad" and which are "good" if there are even number of them? #64

Closed adrianolszewski closed 2 months ago

adrianolszewski commented 2 months ago

In the likert package I can tell where to set the "center" by specifying x.5 (halves) options.

For example, having 6 options {0=no pain, 1=mild, 2=moderate, 3=severe, 4=very severe, 5=horrible pain} I can ask the procedure to draw ONLY the first 2 options (0 and 1) as shades of green (meaning success), and all >= 2 - as shades of yellow/red (meaning problem).

In the likert package the center value would be = 2.5 resulting in: obraz

This cut-off is very important in this case. Is it possible to tell gglikert() where to split the colors in case of even number of items?

larmarange commented 2 months ago

You may have a look at https://github.com/larmarange/ggstats/pull/65

There is a new cutoff argument in gglikert(). It does not work as the likert package. The cutoff represents the number of modalities to be displayed on the left. So if you want to display only two modalities on the left, use cutoff = 2.

If you add a decimal value, it represents the proportion of the central modality to be displayed on the left, i.e. 2.25 to display the two first modalities and a quarter of the third on the left