I want to extract the first non-zero digit of any vector, as for example from a<-runif(100,0,1). Tried it using grep (...) but didn´t work. Any help is very much appreciated. Thanks, Manica -- visite http://ipimar-iniap.ipimar.pt/neomav/