stats-na.contiguous: Find Longest Contiguous Stretch of non-NAs

Description Usage Arguments Value Examples

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

1
2
## 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

1
2
3
4
5
6
## 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 documentation built on Nov. 17, 2017, 2:23 p.m.