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

Bug in sjp.frq for leading zeros #2

Closed
sthesing opened this issue Dec 11, 2014 · 4 comments
Closed

Bug in sjp.frq for leading zeros #2

sthesing opened this issue Dec 11, 2014 · 4 comments
Labels

Comments

@sthesing
Copy link

If the count of the first bar of a frequency plot is 0, wrong values are assigned to the plots.
Two reproducible examples with different results, depending on how the level order is assigned.

mydf <- data.frame(Q=c(rep("No", 5), rep("Maybe", 3)))
levels(mydf[,1]) <- c("Yes", "No", "Maybe")
sjp.frq(mydf[,1], axisLimits.y=c(0,7))

bugreport

mydf <- data.frame(Q=c(rep("No", 5), rep("Maybe", 3)))
mydf[,1] <- ordered(mydf[,1], levels=c("Yes", "No", "Maybe"))
sjp.frq(mydf[,1], axisLimits.y=c(0,7))

bugreport2

@sjPlot
Copy link
Collaborator

sjPlot commented Jun 4, 2015

I haven't solved this issue yet, however, using to_value in the latest sjmisc-snapshot, solves the problem (see strengejacke/sjmisc@520e2a8).

sjp.frq(to_value(mydf[,1]), axisLimits.y=c(0,7)) works for me.
so, issue "half-closed" ;-)

@sjPlot
Copy link
Collaborator

sjPlot commented Jun 4, 2015

Ok, found the bug. I will commit the latest version this evening.

@sthesing
Copy link
Author

Thanks! Works fine.

@sthesing
Copy link
Author

sthesing commented Sep 3, 2015

Hi Daniel,
seems this issue is back. I'm on version sjPlot_1.8.3-3. The examples of my original post yield the exact same results as they did back then.

However,

sjp.frq(to_value(mydf[,1]), axisLimits.y=c(0,7))

still works. So, we're back to half-closed status ;-)

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

No branches or pull requests

2 participants