next_index {gor} | R Documentation |
Next position to i in a cycle
Description
Next position to i in a cycle.
Usage
next_index(i, n)
Arguments
i |
Position in cycle |
n |
Lenght of cycle |
Details
In a cycle, the next slot to the i-th position is i+1 unless i=n. In this case, the next is 1.
Value
The next position in cycle
Author(s)
Cesar Asensio
Examples
next_index(5, 7) # 6
next_index(7, 7) # 1
[Package gor version 1.0 Index]