1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/common_code.R
\name{index2vec}
\alias{index2vec}
\title{Convert indicies to a binary vector}
\usage{
index2vec(x, vars, sign = FALSE)
}
\arguments{
\item{x}{a vector of integers}
\item{vars}{the number of possible locations}
\item{sign}{a lgical; when true the data are encoded as -1/+1, and 0/1
otherwise}
}
\value{
a numeric vector
}
\description{
The function performs the opposite of \code{which} converting a set of
integers to a binary vector
}
\examples{
index2vec(x = 1:2, vars = 5)
index2vec(x = 1:2, vars = 5, sign = TRUE)
}
\author{
Max Kuhn
}
|