mists-set-op: Set operations for run length encoding <'NA'>

Description Usage Arguments Examples

Description

Set operations for run length encoding <NA>

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'rle_na'
intersect(x, y, ...)

## S3 method for class 'rle_na'
union(x, y, ...)

## S3 method for class 'rle_na'
setdiff(x, y, ...)

Arguments

x, y

Objects returned by na_rle() or list_of_na_rle().

...

other arguments passed on to methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
(x <- na_rle(c(1, NA, NA, 4:7, NA, NA, 10:15, NA)))
(y <- na_rle(c(10, NA, NA, NA, 6:3, NA, 1)))
intersect(x, y)
union(x, y)
setdiff(x, y)
setdiff(y, x)
labels <- c("x", "y", "intersect(x, y)", "union(x, y)", "setdiff(x, y)", 
  "setdiff(y, x)")
labels <- factor(labels, levels = labels)
lst_na_rle <- 
  vctrs::as_list_of(
    x, y,
    intersect(x, y),
    union(x, y),
    setdiff(x, y),
    setdiff(y, x)
  )
autoplot(lst_na_rle, labels)

earowang/mists documentation built on Sept. 21, 2019, 1:12 p.m.