R/flipn.R

Defines functions flipn

Documented in flipn

flipn <- function(n){
  # Generate all 2^n Sign-Flipping Vectors
  # Nathaniel E. Helwig (helwig@umn.edu)
  # last updated: October 17, 2018
  # adapted from "bincombinations" in e1071 R package
  
  ns <- 2^n
  sc <- matrix(0, n, ns)
  for(i in 1:n) sc[i,] <- rep(rep(c(-1, 1), each = ns/(2^i)), length = ns)
  sc
  
}

Try the nptest package in your browser

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

nptest documentation built on April 15, 2023, 1:08 a.m.