The ifilter and ifilterfalse functions create iterators
that return a subset of the values of the specified iterable.
ifilter returns the values for which the pred function
returns TRUE, and ifilterfalse returns the values for
which the pred function returns FALSE.
# Return the odd numbers between 1 and 10as.list(ifilter(function(x) x %% 2 == 1, icount(10)))
# Return the even numbers between 1 and 10as.list(ifilterfalse(function(x) x %% 2 == 1, icount(10)))