Closed ans6160 closed 1 year ago
(@petrelharp So R is one-based and Eidos is zero-based. In R, rank(17)
is 1. In Eidos, should it be 0 or 1? In other words, is this a one-based versus zero-based thing, such that Eidos should shift the results to being zero-based, or is there a broader mathematical convention here that Eidos ought to preserve?)
Never mind, I think I answered my own question: https://en.wikipedia.org/wiki/Ranking_(statistics). It should be 1, by convention.
@ans6160 you say "other types would be helpful as well"; do you just mean integer
? Or do you actually have a need for using rank()
with string
or logical
?
Probably just integer. I can't really think of a reason to rank a string or logical. Sorry for the confusion!
Probably just integer. I can't really think of a reason to rank a string or logical. Sorry for the confusion!
OK good, me too. (In a general programming context those other uses of rank()
would also have their uses, but in the context of SLiM it seems unlikely. Anyhow they can be added later if needed.)
OK, this is now in. Types logical
and string
are not supported, and tiesMethod
of "random"
is not supported. Otherwise, I believe it is identical to the R function of the same name.
Hello!
This was discussed on my slim-discussion post and I am following up here to make a formal feature request. If a rank() function could be added so that it can work with at least floats (other types would be helpful as well) that would be fantastic! Thanks!