R/utils.R

Defines functions complement

Documented in complement

#' Find the complementary set
#' 
#' 
#' @param n The size of complete set
#' @param v The vector containing a subset of 1:n
#' 
#' @return This function will return the complementary set of a given subset.
#' 
#' @export
complement <- function(n, v)
{
  x <- rep_len(TRUE, n)
  x[v] <- FALSE
  which(x)
}
wulingyun/BlockSim documentation built on Dec. 4, 2019, 1:54 a.m.