R/AlphaPermute.R

Defines functions AlphaPermute

AlphaPermute <- function(dim) {

  alpha <- matrix(c(0, 1), 2, 1)

  for (i in 1:(dim - 1)) {
    alpha <- rbind(alpha, alpha)
    alpha <- cbind(alpha, c(rep(0, 2 ^ i), rep(1, 2 ^ i)))
  }

  return(alpha)
}

Try the NPCDTools package in your browser

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

NPCDTools documentation built on Sept. 23, 2024, 5:10 p.m.