iter_wrapper: Wrap iterpc objects by iterators::iter

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Wrap iterpc objects by iterators::iter

Usage

1
iter_wrapper(I, d = 1)

Arguments

I

the iterpc object

d

number of permutation(s)/combination(s) wanted in each iteration, default to 1

Value

a iter object compatible with iterators package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(iterators)
I <- iterpc(5, 2)
it <- iter_wrapper(I)
nextElem(it)
nextElem(it)

library(foreach)
I <- iterpc(5, 2)
it <- iter_wrapper(I)
foreach(x=it, .combine=c) %do% { sum(x) }

randy3k/iterpc documentation built on Jan. 9, 2020, 2:02 a.m.