counter: State-full counter object.

Description Usage Arguments Value Examples

Description

State-full counter object.

Usage

1
2
3
4
counter(start = 0)

## S3 method for class 'counter'
print(x, ...)

Arguments

start

initial value

x

an object used to select a method.

...

further arguments passed to or from other methods.

Value

A counter function, each call on which returns a subsequent number.

Examples

1
2
3
4
c <- counter()
c() # returns 0
c() # returns 1
c() # returns 2

lbartnik/utilities documentation built on May 3, 2019, 11:52 p.m.