R/binary.R

Defines functions binary

Documented in binary

#' @export
binary <-
function(q,n=10){
  out <- NULL
  while (q > 0) {
    out <- c(q%%2, out)
    l   <- length(out)
    q <- q %/% 2
  }
  if(l>n) print("Error: n must be greater than length q in binary representation")
  return(c(rep(0, n-l), out))
}
hlennon/copulaIVTS documentation built on Dec. 20, 2021, 4:45 p.m.