Convert indicies to a binary vector
The function performs the opposite of which
converting a set of integers to a binary vector
index2vec(x, vars, sign = FALSE)
x
: a vector of integersvars
: the number of possible locationssign
: a lgical; when true the data are encoded as -1/+1, and 0/1 otherwisea numeric vector
index2vec(x = 1:2, vars = 5) index2vec(x = 1:2, vars = 5, sign = TRUE)
Max Kuhn