Description Usage Arguments Value Examples
The conditions are evaluated only once thus cond() should NOT have side effects.
1 2 3 | iterator_batch_cond(x, batch_size = 1L, cond)
iterator_partition_cond(x, part_size = 1L, cond)
|
x |
an atomic vector |
batch_size |
batch size |
cond |
a conditional function, must be vectorised. |
part_size |
partition size. |
an iterator
1 2 3 4 5 6 | x <- runif(n = 50)
f <- function(a) a < 0.8
itr1 <- iterator_batch(x, 3)
itr2 <- iterator_batch_cond(x, 3, f)
collect(itr1)
collect(itr2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.