index2vec function

Convert indicies to a binary vector

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)

Arguments

  • x: a vector of integers
  • vars: the number of possible locations
  • sign: a lgical; when true the data are encoded as -1/+1, and 0/1 otherwise

Returns

a numeric vector

Examples

index2vec(x = 1:2, vars = 5) index2vec(x = 1:2, vars = 5, sign = TRUE)

Author(s)

Max Kuhn

  • Maintainer: Max Kuhn
  • License: GPL (>= 2)
  • Last published: 2024-12-10