% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aux_outer.R
\name{hex2bin}
\alias{hex2bin}
\alias{bin2hex}
\title{Converting Binary Code to and from Hexadecimal Code}
\usage{
hex2bin(hexcode)

bin2hex(binvec)
}
\arguments{
\item{hexcode}{a single-element character denoting an integer in hexcode
(admissible character: 0 to 9, ato f)}

\item{binvec}{a logical vector (alternatively a vector coercible into
logical)}
}
\value{
\code{bin2hex} returns a single element character; \code{hex2bin}
returns a numeric vector equivalent to a logical vector
}
\description{
A simple-to-use function for converting a logical ('binary') vector into hex
code and reverse.
}
\details{
The argument is an integer in binary form (such as "101"), provided as a
logical (\code{c(T,F,T)}) or numeric vector (\code{c(1,0,1)}).\cr
\code{bin2hex} then returns a character denoting this number in hexcode (in
this case "5").

The function \code{hex2bin} does the reverse operation, e.g.
\code{hex2bin("5")} gives (\code{c(1,0,1)}).
}
\examples{

  bin2hex(c(TRUE,FALSE,TRUE,FALSE,TRUE,TRUE))
  bin2hex(c(1,0,1,0,1,1))
  hex2bin("b8a")
  bin2hex(hex2bin("b8a"))

}
\seealso{
\code{\link{hex2bin}} for converting hexcode into binary vectors,
\code{\link{format.hexmode}} for a related R function.

Check \url{http://bms.zeugner.eu} for additional help.
}
\keyword{arith}
