ifor {eList}R Documentation

'for' Loop with Additional Features

Description

ifor evaluates an expression within a for loop, after applying iter to the sequence. ifor also allows multiple indexes by separating each variable name with a ".", such that ifor(x, i.j, ...) is similar to for (i,j in x) ... if for loops accepted multiple index values. See comprehension for more details. Assignment to a variable outside of the function can be accomplished through assign or <<-.

Usage

ifor(ind, x, expr)

Arguments

ind

variable name whose values are updated each round in the loop. Separate names with "." to allow for multiple variables

x

sequence over which to loop

expr

expression that is evaluated each round within the loop

Value

NULL invisibly

Examples

ifor(i.j, zip(1:4, 0:3),{
 print(i+j)
})


[Package eList version 0.2.0 Index]