R/decToBin.R

decToBin <-
function(x, m) {

  bin <- array(0, c(length(x),m))
  for(i in 1:m) {
    bin[,m - i + 1] <- x %% 2
    x <- x %/% 2
  }

  return(bin)

}

Try the genMOSSplus package in your browser

Any scripts or data that you put into this service are public.

genMOSSplus documentation built on May 1, 2019, 10:31 p.m.