Learn R Programming

segtest (version 2.0.0)

iter.array: Iterator over array

Description

Iterator over array

Usage

# S3 method for array
iter(obj, by = 1, recycle = FALSE, ...)

Value

An iterator. This is an S3 arrayiter object, used in conjunction with nextElem to iterate over one index of an array.

Arguments

obj

An array.

by

The dimension to iterate over.

recycle

Should the iterator reset?

...

not used

Author

David Gerard

See Also

nextElem.arrayiter()

Examples

Run this code
glist <- multidog_to_g(
  mout = ufit,
  ploidy = 4,
  type = "all_gl",
  p1 = "indigocrisp",
  p2 = "sweetcrisp")
g <- iterators::iter(glist$g, by = 3)
head(iterators::nextElem(g))
head(iterators::nextElem(g))
head(iterators::nextElem(g))

Run the code above in your browser using DataLab