Learn R Programming

dse (version R2000.6-1)

trim.na: Trim NAs from Time Series

Description

Trim NAs from the ends of a time series object.

Usage

trim.na(obj, start.=T, end.=T)

Arguments

obj
start.
If start.=F then beginning NAs are not trimmed.
end.

Value

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

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.

Examples

Run this code
trim.na(ts(rbind(NA, matrix(1:20,10,2)), start=c(1980,1), frequency=12))

Run the code above in your browser using DataLab