Bug 400755

Summary: Factor levels are displayed sorted by string sort, instead of numeric sort of levels.
Product: [Applications] rkward Reporter: Thomas Friedrichsmeier <thomas.friedrichsmeier>
Component: User InterfaceAssignee: RKWard Team <rkward-devel>
Status: CONFIRMED ---    
Severity: normal CC: bugs.kde.org
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Thomas Friedrichsmeier 2018-11-06 17:20:02 UTC
To reproduce:
 x <- data.frame(a=letters)
 rk.edit(x)
 [click on a cell in the table]
Factor levels are shown "1:a" followed by "10:j".

Likely cause is that we are storing the level key as a string.
Comment 1 Thomas Friedrichsmeier 2018-11-06 17:22:17 UTC
Git commit 1a03828b813c0fb34067b978da9ff0afe500bb5a by Thomas Friedrichsmeier.
Committed on 06/11/2018 at 17:20.
Pushed by tfry into branch 'master'.

Limit number of factor levels to show in popup.

I was a bit too fast in calling that bug fixed, but now it should be:

M  +9    -1    rkward/misc/celleditor.cpp

https://commits.kde.org/rkward/1a03828b813c0fb34067b978da9ff0afe500bb5a
Comment 2 Thomas Friedrichsmeier 2018-11-06 18:01:55 UTC
Grr. Marked the wrong bug as fixed. Commit below was targeted at bug #380742 .
Comment 3 m.eik michalke 2018-11-06 20:11:10 UTC
(In reply to Thomas Friedrichsmeier from comment #0)
> Likely cause is that we are storing the level key as a string.

also, R 3.5 now internally uses some automatic detection of the "best" sorting algorithm to use for all kinds of things. i had to update unit test standards in one of my packages because of this. sorting character values can depend on the locale set, which if you ask me is a terrible idea if you need reliable results.
Comment 4 Justin Zobel 2022-12-02 01:22:53 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!