Description Usage Arguments Value Examples
Iterator over combinations with repetions of a given set of modelTypes
1 2 3 4 5 | PCMIteratorMapping(
mapping,
modelTypes,
allowedModelTypesIndices = rep(list(NULL), length(mapping))
)
|
mapping |
a vector of elements from modelTypes giving the initial combination |
modelTypes |
a vector of unique elements to choose from when building the combinations. |
allowedModelTypesIndices |
a list of the same length as |
an iterator object with S3 class c("imapping", "abstractiter",
"iter")
.
Calling repeatedly nextElem on this object iterates over all possible
combinations with repetitions of the same length as the argument
mapping
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(iterators)
it <- PCMIteratorMapping(c(1, 1), c(1, 2, 3))
nextElem(it)
nextElem(it)
nextElem(it)
nextElem(it)
it <- PCMIteratorMapping(c(1, 1), c(1, 2, 3), list(NULL, 1:2))
nextElem(it)
nextElem(it)
nextElem(it)
nextElem(it)
nextElem(it)
nextElem(it)
it <- PCMIteratorMapping(c("BM", "BM"), c("BM", "OU", "JOU"))
nextElem(it)
nextElem(it)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.