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

reverse natural order for plot and ordered = FALSE #53

Closed
sgibb opened this issue Mar 22, 2016 · 1 comment
Closed

reverse natural order for plot and ordered = FALSE #53

sgibb opened this issue Mar 22, 2016 · 1 comment

Comments

@sgibb
Copy link

sgibb commented Mar 22, 2016

This issue is somehow related to #33.

I like to keep my questions in the order as they occur in the questionnaire. While this is working in the likert object (foo1, foo2) plot change this order (from top to bottom foo2, foo1).

MWE:

library("likert")

d <- data.frame(foo1=factor(c(2, 1), levels=1:3, labels=c("yes", "maybe", "no")),
                foo2=factor(c(1, 1), levels=1:3, labels=c("yes", "maybe", "no")))
l <- likert(d)
#   Item yes maybe no
#1 foo1  50    50  0
#2 foo2 100     0  0
plot(l, ordered=FALSE)

l

Is there a way to get foo1, foo2 from top to bottom in the plot method?

@sgibb
Copy link
Author

sgibb commented Mar 27, 2016

Sorry, the answer is RTFM.
I found group.order in the documentation. The following works as expected.

plot(l, ordered=FALSE, group.order=names(d))

@sgibb sgibb closed this as completed Mar 27, 2016
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