0

Given the following vector:

a <- c(1, 6, 6, 6, 11)

How do I output a corresponding vector of value ranks like the one below

1 2 2 2 5

If I use rank() function it produces 1 3 3 3 5

2
  • rank(x, na.last = TRUE, ties.method = c("average", "first", "last", "random", "max", "min")) Commented Oct 22, 2024 at 7:47
  • @user2974951 did you mean to say "min"? Commented Oct 22, 2024 at 7:53

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.