ring: bring vector values into ring form...

Description Usage Arguments Details Value Examples

Description

bring vector values into ring form

Usage

1
ring(x, upper)

Arguments

x

vector

upper

upper limit of range (lower is one. TODO: maybe extend???)

Details

the values of a vector that are outside of a given range are remapped to the values of the range. This function is useful for loops over rows and columns of a matrix if the

Value

vector

Examples

1
2
3
4
5
6
7
8
## Not run: 
ring(1:10, 3)

m <- matrix(1:12, ncol=4)
for(i in 1:12)
print(m[ring(i, 3), map(i, 4)])

## End(Not run)

OpenRepGrid documentation built on May 2, 2019, 4:54 p.m.