Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bar plot and grouped unused levels buggy #126

Open
moapy opened this issue May 4, 2022 · 0 comments
Open

bar plot and grouped unused levels buggy #126

moapy opened this issue May 4, 2022 · 0 comments

Comments

@moapy
Copy link

moapy commented May 4, 2022

Unused levels seems to break grouped bar charts.

I'm trying to show right skewed likert data that is also grouped.

My Likert summary looks fine (generated using likert::likert(dat, grouping = dat$group))

Group Item Strongly Disagree Disagree Slightly Disagree Slightly Agree Agree Strongly Agree
Group 1 Item 1 0 0 0 0 20 80
Group 1 Item 2 0 0 0 0 20 80
Group 2 Item 1 0 0 0 10 40 50
Group 2 Item 2 0 0 0 20 60 20

However, this will not plot: plot(likert::likert(dat, grouping = dat$group)

Error in seq_len(n) : argument must be coercible to non-negative integer

I'm pretty sure it relates to the grouping/and or the skew in the data, as I **can generate a plot for each Group individually** no worries, or if **I artificially create a new row in my dataset and add a single Strongly Disagree to each item and group, then it works fine,** producing the grouped plot with both items?!?!

This o**nly occurs for the bar type**, it doesn't happen if I set the density plot option plot(q_ab.s, type = "density")

I've also noticed that if I produce any plot with likert() that has an unused level (common with the small samples I work with), the formatting is totally weird, with a big empty space at the top. I wonder if this is related?

enter image description here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant