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

Preserve order of factor levels #46

Closed
sebastien-foulle opened this issue Sep 6, 2019 · 1 comment
Closed

Preserve order of factor levels #46

sebastien-foulle opened this issue Sep 6, 2019 · 1 comment
Assignees

Comments

@sebastien-foulle
Copy link

Barcharts list factor levels in alphabetical order. The problem comes from dataMaid:::standardVisualCFLB , a solution might be to replace the line

v<- escapeRStyle(na.omit(v))

with something like

v = na.omit(v)
  modalites = levels(v)
  if (is.null(modalites)) {
    v <- dataMaid:::escapeRStyle(v)
  } else {
      new_modalites = dataMaid:::escapeRStyle(modalites)
      levels(v) = new_modalites
    }

Have a good day

@annennenne
Copy link
Collaborator

Thank you for notifying us of this issue! I have fixed it now in the github version of the package.

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

No branches or pull requests

2 participants