R/one2two.R

#' @rdname two2one
#' 
#' @export

"one2two" <-
function(M,clu=NULL){
  if(!is.null(clu)){
    if(mode(clu)=="list"){
      n<-sapply(clu,FUN=length)
      newM<-M[1:n[1],(n[1]+1):sum(n[1:2])]
    } else stop("For now clu must be supplied in form of a list (one component for each mode)")
  } else stop("For now clu must be supplied in form of a list (one component for each mode)")
  return(list(M=newM,clu=clu))
}

Try the blockmodeling package in your browser

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

blockmodeling documentation built on Aug. 23, 2023, 5:07 p.m.