rotate_JS: Create rotational combination in JS array format

Description Usage Arguments Examples

Description

This function is exclusively used for Rail Gen 2.0 project series to create rotational combination in JS array format

Usage

1
rotate_JS(vector = x, direction = c("left", "right"), keep_zero)

Arguments

vector

numeric vector

direction

c("left", "right")

keep_zero

logical

Examples

1
2
3
4
rotate_JS(c(1:4), "right", keep_zero=TRUE)
#"1:[0,1,2,3,4]," "2:[0,4,1,2,3]," "3:[0,3,4,1,2]," "4:[0,2,3,4,1],"
rotate_JS(c(1:4), "left", keep_zero=TRUE)
#"1:[0,1,2,3,4]," "2:[0,2,3,4,1]," "3:[0,3,4,1,2]," "4:[0,4,1,2,3],"

momo3246/recode documentation built on Sept. 30, 2020, 2:14 p.m.