Find missing elements in x with respect to y

gaps(x, y)

Arguments

x, y

Atomic vectors. The length of y must be greater than the length of x.

Value

A tibble of columns .from, .to and .n.

Examples

gaps(x = c(1:3, 5:6, 9:10), y = 1:10)
#> # A tibble: 2 x 3 #> .from .to .n #> <int> <int> <int> #> 1 4 4 1 #> 2 7 8 2