this is what happened with me:that when I get to the second element h[n] becomes h[2] which doesn't exist (h[1] obviously did). Any suggestions -- View this message in context: http://r.789695.n4.nabble.com/Min-Max-tp4593065p4593401.html Sent from the R help mailing list archive at Nabble.com.