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

stats-na.contiguous

Find Longest Contiguous Stretch of non-NAs


Description

Find the longest consecutive stretch of non-missing values in a timeSeries object. (In the event of a tie, the first such stretch.)

Usage

## S4 method for signature 'timeSeries'
na.contiguous(object, ...)

Arguments

object

a timeSeries object.

...

further arguments passed to or from other methods.

Value

A timeSeries object without missing values.

Examples

## Dummy timeSeries with NAs entries
   data <- matrix(sample(c(1:20, rep(NA,4))), ncol = 2)
   s <- timeSeries(data, timeCalendar())
   
## Find the longest consecutive non-missing values
   na.contiguous(s)

timeSeries

Financial Time Series Objects (Rmetrics)

v3062.100
GPL (>= 2)
Authors
Diethelm Wuertz [aut] (original code), Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb] (<https://orcid.org/0000-0002-8685-9910>)
Initial release
2020-01-24

We don't support your browser anymore

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