count_gaps {tsibble}R Documentation

Count implicit gaps

Description

Count implicit gaps

Usage

count_gaps(.data, ...)

## S3 method for class 'tbl_ts'
count_gaps(.data, .full = FALSE, ...)

Arguments

.data

A tbl_ts.

...

Other arguments passed on to individual methods.

.full

FALSE to find gaps for each group within its own period. TRUE to find gaps over the entire time span of the data.

Value

A tibble contains:

See Also

Other implicit gaps handling: fill_gaps, has_gaps, scan_gaps

Examples

ped_gaps <- pedestrian %>% 
  count_gaps(.full = TRUE)
if (!requireNamespace("ggplot2", quietly = TRUE)) {
  stop("Please install the ggplot2 package to run these following examples.")
}
library(ggplot2)
ggplot(ped_gaps, aes(x = Sensor, colour = Sensor)) +
  geom_linerange(aes(ymin = .from, ymax = .to)) +
  geom_point(aes(y = .from)) +
  geom_point(aes(y = .to)) +
  coord_flip() +
  theme(legend.position = "bottom")

[Package tsibble version 0.6.2 Index]