m-jahn / WeightedTreemaps

Create Voronoi and Sunburst Treemaps from Hierarchical data
GNU General Public License v3.0
47 stars 9 forks source link

sorting and/or labeling of cells wrong for certain labels #29

Closed m-jahn closed 1 year ago

m-jahn commented 1 year ago
olgabaranov commented 1 year ago

Can confirm the bug. Additionally, sorting the data frame by the column which is used for the labels seems to fix the issue applying tolower or toupper fixes it, even though my labels were lowercase to begin with...

m-jahn commented 1 year ago

I need to investigate this, did not have time until now. Thanks for confirming.

m-jahn commented 1 year ago

I've investigating, it turned out that the error was caused by base R sorting through table as compared to sorting by dplyrs arrange. When do capital letters follow in succession, they treat the order differently. Compare:

RNA degradation
RNA polymerase
Ribosome
Unknown

to

Ribosome
RNA degradation
RNA polymerase
Unknown 

Of of them gives priority to the capital writing and the other to the alphabetical order of the second letter.