Description Usage Arguments Value Examples
Test whether a binary predicate holds for all direct neighbors in a list
1 | all_neighbors(f, ...)
|
f |
Binary function used for comparing neighboring elements of ‘x’ |
... |
One or more lists or vectors (holding elements of the same type) |
TRUE if all neighboring elements (even across lists) compare TRUE, otherwise FALSE.
1 2 3 4 5 6 7 8 9 | all_neighbors(identical, c(1,1,1))
all_neighbors(identical, c(1,2,1))
all_neighbors(identical, c(NA,NA,NA))
all_neighbors(identical, c(1,NA,1))
all_neighbors(function(x,y) TRUE, 1:5)
all_neighbors(function(x,y) FALSE, c(1,1,1))
all_neighbors(function(x,y) y - x == 1L, 1:10)
all_neighbors(`<`, 1:10, 100:200)
all_neighbors(`<=`, list(a = 1, b = 3), list(c = 3, d = 5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.