powered by
The function performs the opposite of which converting a set of integers to a binary vector
which
index2vec(x, vars, sign = FALSE)
a numeric vector
a vector of integers
the number of possible locations
a lgical; when true the data are encoded as -1/+1, and 0/1 otherwise
Max Kuhn
index2vec(x = 1:2, vars = 5) index2vec(x = 1:2, vars = 5, sign = TRUE)
Run the code above in your browser using DataLab