Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

iapply

Array/Apply Iterator


Description

Returns an iterator over an array, which iterates over the array in much the same manner as the apply function.

Usage

iapply(X, MARGIN)

Arguments

X

the array to iterate over.

MARGIN

a vector of subscripts. 1 indicates the first dimension (rows), 2 indicates the second dimension (columns), etc.

Value

The apply iterator.

See Also

Examples

a <- array(1:8, c(2, 2, 2))

# iterate over all the matrices
it <- iapply(a, 3)
as.list(it)

# iterate over all the columns of all the matrices
it <- iapply(a, c(2, 3))
as.list(it)

# iterate over all the rows of all the matrices
it <- iapply(a, c(1, 3))
as.list(it)

iterators

Provides Iterator Construct

v1.0.13
Apache License (== 2.0)
Authors
Michelle Wallig [cre], Revolution Analytics [aut, cph], Steve Weston [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.