x <- rnorm(200)
f <- factor(sample(1:10, length(x), replace = TRUE))
it <- isplit(x, f)
expected <- split(x, f)
for (i in expected) {
actual <- nextOr(it, break)
stopifnot(actual$value == i)
}
Run the code above in your browser using DataLab