[R] Internal NA removal out of Time Series with na.omit.ts()

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Mar 5 15:40:48 CET 2004


On Fri, 5 Mar 2004, Jan Verbesselt wrote:

> The na.omit.ts() method fails when the time series contains internal
> NA's. How can these automatically be removed?

It is impossible, as you have been told recently.  You cannot have a 
regular time series with gaps.

> > spectrum(ts.mNDII, na.action=na.omit)
> Error in na.omit.ts(as.ts(x)) : time series contains internal NAs
> 
> How can the na.action be activated correctly?
> 
> > acf(ts.Lin, type=c("correlation"), na.action=na.omit)
> Error in na.omit.ts(as.ts(x)) : time series contains internal NAs
> 
> ((ts.Lin contains two time series, where one contains internal NAs
> (-->an NA not a the end/beginning of a time serie)))

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list