To return the index of the smallest value in a vector, you can use the which.min() function from the base package as follows
v=c(100,300,150,400,50,450,250,150,400)
which.min(v)
[1] 5
You can also use the which function from base R as follows:
which(v == min(v))
[1] 5