Jan Verbesselt
2004-Mar-05 12:50 UTC
[R] Internal NA removal out of Time Series with na.omit.ts()
Hi R specialists, The na.omit.ts() method fails when the time series contains internal NA's. How can these automatically be removed?> 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))) Thanks a lot! Jan Verbesselt
Prof Brian Ripley
2004-Mar-05 14:40 UTC
[R] Internal NA removal out of Time Series with na.omit.ts()
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
Adrian Trapletti
2004-Mar-08 08:01 UTC
[R] Internal NA removal out of Time Series with na.omit.ts()
> > Hi R specialists, > > The na.omit.ts() method fails when the time series contains internal > NA's. How can these automatically be removed?try na.remove from tseries. This is, e.g., useful when removing weekends (NA prices) from financial data, i.e., switching from physical time to business time. best Adrian> >>> 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))) > >Thanks a lot! > >Jan Verbesselt > > > >Dr. Adrian Trapletti Trapletti Statistical Computing Wildsbergstrasse 31, 8610 Uster Switzerland Phone & Fax : +41 (0) 1 994 5631 Mobile : +41 (0) 76 370 5631 Email : mailto:a.trapletti at bluewin.ch WWW : http://trapletti.homelinux.com