-
Notifications
You must be signed in to change notification settings - Fork 72
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
factor levels order is not retained #104
Comments
This would have to be passed to the JS layer via |
Hello, I've tried the solution proposed in #106, but in my case it still won't give the correct result. See my example:
I'm running:
Thanks! |
@rlavelli your desired output does not seems to be corresponding to your data. Are you on old R version having different random generator algo? Please include set.seed(123)
dat <- data.frame(
x = rnorm(30)*10,
y = rnorm(30)*10
)
dat$x_cut = cut(dat$x,5)
dat$y_cut = cut(dat$y,5) will do. Also please provide output of |
Thank you for the reply, and sorry to bother. For the sake of completeness, here's the info you asked (in a clean R session).
I was actually able to fix the sorting problem by adding an increasing number before each I'll try to install the full branch update and test it. Again, Thank you. |
Your workaround is basically avoiding the problem in the first place. As stated in this issue, alphabetical order is used instead of order of levels, thus adding a prefix number is disabling the issue. To easily install this branch you can use remotes::install_github("jangorecki/rpivotTable@factor-sorters") Please report back if you still have a problem even when using this branch. |
@rlavelli any news if the branch address your case? |
I'm sorry for the delay. I've tried the full branch and it works. Thank you! |
Using factor is nice when you want to have ordered your strings, and is being used commonly in plotting libraries/functions. I don't see reason why pivot table should behave differently.
Below example shows that order of levels is ignored. This feature request is about ordering those
rows
/cols
entries according to order of factor levels.factor levels could automatically populate
sorters
argument.The text was updated successfully, but these errors were encountered: