\Header{trimNA}{Trim NAs from Time Series}
\methalias{trimNA.default}{trimNA}
\keyword{programming}{trimNA}
\keyword{utilities}{trimNA}
\keyword{ts}{trimNA}
\keyword{chron}{trimNA}
\begin{Description}\relax
Trim NAs from the start and end of a time series object.
\end{Description}
\begin{Usage}
\begin{verbatim}
    trimNA(x, startNAs=TRUE, endNAs=TRUE)
    ## Default S3 method:
    trimNA(x, startNAs=TRUE, endNAs=TRUE)
    \end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] A time series matrix or an object of class TSdata.
\item[\code{startNAs}] If FALSE then beginning NAs are not trimmed.
\item[\code{endNAs}] If FALSE   then ending NAs are not trimmed.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Trim NAs from the ends of a time series object.
Observations in a given period for all series are dropped if any one contains an NA.
\end{Details}
\begin{Value}
A time series object which is windowed to the subset of 
data which is not NAs (usually the available data).\end{Value}
\begin{Examples}
\begin{ExampleCode}
trimNA(ts(rbind(NA, matrix(1:20,10,2)), start=c(1980,1), frequency=12))
\end{ExampleCode}
\end{Examples}

