R/Partition2gr.r

Defines functions Partition2gr

Documented in Partition2gr

#' Computes N-1 possible partitions of ordered N into 2 subsets. 
#'
#' @keywords internal
Partition2gr <- function(N)
{
  Partitions <- list()
  labelgr1 <- 1
  labelgr2 <- 2
  partition <- rep(labelgr2, N)
  for(i in 1:(N-1))
  {
    temp <- partition
    temp[1:i] <- labelgr1
    Partitions[[i]] <- temp
  }
  Partitions
}

Try the cytometree package in your browser

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

cytometree documentation built on Dec. 5, 2019, 1:06 a.m.