Here is what my Rstudio tells me:
> x <- c(31, 4, 15, 92, 65)
> x
[1] 31 4 15 92 65
> rank(x) # returns ranks (smallest to largest)
[1] 3 1 2 5 4
The obviously correct answer is “[1] 2 3 1 5 4”
How can something so simple and obvious come out wrong?