inst/examples/productExample.R

library(itertools)
library(foreach)

it <- product(a=LETTERS[1:10], b=1, x=1:3)

success <- 
  foreach(a=LETTERS[1:10], .combine='c', .final=all) %:%
    foreach(b=1, .combine='c') %:%
      foreach(x=1:3, actual=it, .combine='c') %do%
        identical(list(a=a, b=b, x=x), actual)

print(success)

Try the itertools package in your browser

Any scripts or data that you put into this service are public.

itertools documentation built on May 30, 2017, 5:31 a.m.