bado<-c(0,2,1,2,3,4,1,0,0,2)
bado
which.min(bado[bado>0])
Hi, I want to find the index of the nonzero minimum value. I tried which.min function but which.min disregards the index of the zeros when counting indexes. In my code. min output should be 3 but it gives 2 as an output. How can I solve this? What should I use to find the real index?