# Filters out numbers exceeding 3
not_too_large <- function(x) {
x <= 3
}
it <- i_dropwhile(1:8, not_too_large)
as.list(it)
# Same approach but uses an anonymous function
it2 <- i_dropwhile(seq(2, 20, by=2), function(x) x <= 10)
as.list(it2)
Run the code above in your browser using DataLab