Skip to content

colRanks() problems with ties methods #129

@vonGameTheory

Description

@vonGameTheory

Describe the bug

When using method="random" to break ties in colRanks() function, results are strange and wrong giving zeros and not breaking ties. Even when there are no ties in a column, it gives wacky results.

method="min" just hangs or crashes! no results at all!

To Reproduce
colRanks( matrix(1:20,5,4), method="random")
It is using randomness, so result changes from call to call, but this which doesn't even have any ties gives results like the following (for example):

[,1] [,2] [,3] [,4]

[1,] 4.5 4 3 1
[2,] 2.0 0 4 2
[3,] 0.0 5 0 5
[4,] 3.0 0 5 4
[5,] 0.0 0 0 0

giving zeros (?) and not breaking ties (often giving middle values like 3.5)

using method="min" on same matrix and process just hangs -- I have to abort. If there are ties, it crashes outright.

The other methods average, max and first seem ok at first glance, but I haven't checked them for correctness thoroughly. I've used the default "average" plenty in the past with no troubles (that I've noticed), but probably all the ties code should be double-checked. I didn't test parallel options at all.

Expected behavior
Obviously, zeros should never occur in any ranking result. It should rank the columns and not crash! ("average" is the only one that should ever give non-unique positive ranks in the presence of ties -- all the other methods should break the ties according to their rule)

Desktop (please complete the following information):

  • OS: Linux: endeavourOS (arch-based) (w/ intel MKL blas)
  • R-Version: 4.5.0
  • Rfast-Version: 2.1.5.1
  • GCC-Version: 15.1.1

( also tried on another linux machine with same results, but config is virtually the same )

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions