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

naWindow

Exclude NA and Zero Observations


Description

Windows a tis or ts time series to cut off leading and trailing NA (and optionally zero) observations.

Usage

naWindow(x, union = F, zero = F)

Arguments

x

a tis or ts time series

union

see details below

zero

if TRUE, chop off leading and trailing zeroes also

Details

For multivariate (multiple columns) series and union = TRUE, a row of x is considered to be NA if and only if all entries in that row are NA. If union = FALSE (the default), a row is considered to be NA if any of its entries is NA.

if zero is TRUE, the function chops off leading and trailing observations that are either NA or zero. Otherwise, it chops only NAs.

Value

A copy of x with leading and trailing NA observations deleted.

See Also


tis

Time Indexes and Time Indexed Series

v1.38
Unlimited
Authors
Jeff Hallman <jeffhallman@gmail.com>
Initial release

We don't support your browser anymore

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