find the position of the first value who equals certain number in a vector:

Say a=c(0,0,0,0,0.2, 0.2, 0.4,0.4,0.5)

i wish to return the index value in a for which the value in the vector is
equal to 0.4 for the first time. in this case, it is 7.

	[[alternative HTML version deleted]]

