enum: Enumerate

View source: R/enum.R

enumR Documentation

Enumerate

Description

Aids enumeration and merging (via rbind_loop) in loops: adds numbers to a vector input, and indicates loop start for rbind_loop.

Usage

enum(items, hush = FALSE, enumerate = TRUE)

Arguments

items

The items to be enumerated in the loop.

hush

Logical. If TRUE (default), prints "Loop started." when executed.

enumerate

Logical. If TRUE (default), adds numbering to the input vector (in item pairs, see Examples). If FALSE, returns the original input.

Value

Vector with numbers added (if so set).

See Also

rbind_loop

Examples


my_vector = c('aa', 'bb', 'cxyz', 'last')

for (item in enum(my_vector)) {
    print(item)
}

# just to show what enum() returns
enum(my_vector)


gasparl/neatstats documentation built on Jan. 10, 2023, 6:23 a.m.