On Mon, Sep 12, 2011 at 4:42 AM, Eran Eidinger <e...@taykey.com> wrote: > Hello, > > I have a time-series that has some missing samples. > I was thinking on completing them using either zero-order hold or linear > interpolation. > I am looking for an efiicient way (other than a loop...) of identifiying the > missing time slots and filling them. > > Can you think of any methods that might help here? (obviously > which(diff(time)>min(diff(time))) will give the locations, but what > then....?) >
The zoo package has na.approx, na.fill, na.locf, na, na.spline na.StructTS and the stinepack package has na.stinterp. Each of these fill in NAs in zoo series and certain other objects. See the help files for many examples. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ R-help@r-project.org 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.