I would like to identify which coordinate of my vector gives me the greatest value. For a simple example suppose that:
x <- c(10,22,20,18,5)
which.max is your friend as pointed out by @Hong Ooi
which.max
> x <- c(10,22,20,18,5) > which.max(x) [1] 2
Another (not optimal way) is a combination of which and max.
which
max
> which(x==max(x)) [1] 2