ifor: 'for' Loop with Additional Features

Description Usage Arguments Value Examples

View source: R/ifor.R

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

1
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

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

eList documentation built on Jan. 23, 2021, 1:05 a.m.