You're moving the goal posts. If you need to deal with internal as well as terminal NA values in a particular way, it would help to have told us that up front.
Please give us some sample data that illustrates what you're really trying to work with, and a full explanation of what you need to accomplish. Sarah On Thu, May 10, 2012 at 8:41 AM, jeff6868 <[email protected]> wrote: > Thanks for your answer too Berend. > Yes you're right about x[i+1]. You answered juste before me. > Well your idea of declaring all in numeric is great. It avoids my problem. > But actually I also have small missing data gaps in the rest of my data (in > the middle of numeric values). > And one of the aim of my function is to avoid comparison between 2 numeric > values which are separated with a long period of time (with NA inside), in > order for example not to compare a value of the 1st january and the next > numeric value of the 1st april. > I'm trying to combine both. For the moment, it works only for data which > doesn't ends with NAs as you've understood. With numeric() for st1, the > problem of NAs at the end is solved but it creates a new problem with the > other NAs (which was OK before). Do you better understand what I'm trying to > do? > If you have an other idea, It'll be welcomed. > Thanks > -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

