Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trimNA

Trim NAs from Time Series


Description

Trim NAs from the start and end of a time series object.

Usage

trimNA(x, startNAs=TRUE, endNAs=TRUE)
    ## Default S3 method:
trimNA(x, startNAs=TRUE, endNAs=TRUE)

Arguments

x

A time series matrix or an object of class TSdata.

startNAs

If FALSE then beginning NAs are not trimmed.

endNAs

If FALSE then ending NAs are not trimmed.

Details

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.

Value

A time series object which is windowed to the subset of data which is not NAs (usually the available data).

Examples

trimNA(ts(rbind(NA, matrix(1:20,10,2)), start=c(1980,1), frequency=12))

tframe

Time Frame Coding Kernel

v2015.12-1.1
GPL-2
Authors
Paul Gilbert <pgilbert.ttv9z@ncf.ca>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.