Closed ruialv closed 7 years ago
I have the same issue. I've been playing around in likert.bar.plot
around lines 87 and 189 with various combinations of trying to reverse the data and the fill, e.g.,:
geom_bar(data = results.high[nrow(results.high):1,], aes(fill = rev(variable)),
stat = "identity")
I can get the colors to correctly order by using rev
with the fill
part, but the data is wrong, still in the wrong order from highest at 0 to lowest at the right end of the bar.
I did get the colors and order to work using this instead of the above:
geom_bar(data = results.high, aes(fill = variable, group=rev(variable)),
stat = "identity")
However, I don't know why it works, since the lines above them don't need the group formally specified. Hopefully the package owners will be able to sort that out?
FWIW, the values/color order also fails to plot correctly when you use grouping and centered = FALSE
.
I also have a extra response type showing up on grouped data plots. Along with this swapped value issue.
I can second that this happens when using ggplot2 2.2.0. Reverting to 2.1.0 fixes it. Perhaps it is related to the new stacking methods used in the ggplot2.
I have the same problem, and beat my head against the wall until finding this thread. ggplot2 2.1.0 fixed it for me as well.
I was having the same problem this fixed it - thank you so much for posting!!!!
This has been fixed and on CRAN now.
Thanks, Jason, for the update, but many more thanks for such a great package!!!
This still isn't working for me. Is there a package I should update? I tried re-ordering my levels and it's still not reading in the Likert plot.
Thanks!
With all the changes to ggplot2, this package needs updating. It is on my list to work on this summer.
On Wed, May 16, 2018 at 11:29 AM, avierse notifications@github.com wrote:
This still isn't working for me. Is there a package I should update? I tried re-ordering my levels and it's still not reading in the Likert plot.
Thanks!
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jbryer/likert/issues/63#issuecomment-389561563, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmEjxdHn0Li45OaC803u0sqVA4sz8s1ks5tzEW_gaJpZM4K4aUg .
Hello, thank you very much for providing this very useful package! I noticed this issue has been closed, but I still have this issue, the color is incorrect. The version of ggplot2 installed is 3.1.1.
Hello,
First things first: thank you for this great package! I use it a lot. Now, let's try to replicate the bug(?).
require(likert)
Using demo data
data(pisaitems)
items28 <- pisaitems[, substr(names(pisaitems), 1, 5) == "ST24Q"]
Prepare data to plot likert
l28 <- likert(items28)
Levels are ploted in the correct order
plot(l28)
Prepare grouped data by CNT to plot likert
l28g <- likert(items28, grouping = pisaitems$CNT)
"Strongly agree" apears before "Agree" level
plot(l28g)
Here's my session info:
I've been keeping all packages updated. Could it be related to ggplot2 version 2.2.0? (Just tried with 2.1.0 version and had the same issue) [UPDATE: It really is related to ggplot2_2.2.0, works fine with 2.1.0. One needs to uninstall 2.2.0, restart R and install 2.1.0] Thanks,