R/binary_vector_gen.R

Defines functions binary_vector_gen

Documented in binary_vector_gen

#' Make a binary vector with all values equal to zero except for one
#'
#' @param n Desired vector length.
#' @param i Index whose value is one.
#' @return A vector

binary_vector_gen <- function(n, i){
  a <- rep(0, n)
  a[i] <- 1
  return(a)
}

Try the biclustermd package in your browser

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

biclustermd documentation built on June 17, 2021, 5:11 p.m.