Petr and Bill, Thanks for your replies. I have gone with Petr use of na.locf(), but expect I can use Bill's full function in the near future. Chris -- View this message in context: http://r.789695.n4.nabble.com/Vector-replace-0-elements-without-using-a-loop-tp2966191p2968909.html Sent from the R help mailing list archive at Nabble.com.