R/two2one.R

"two2one" <-
function(M,clu=NULL){
	n1<-dim(M)[1]
	n2<-dim(M)[2]
	n<-n1+n2
	M1<-matrix(0,nrow=n,ncol=n)
	M1[1:n1,(n1+1):n]<-M
	dimnames(M1)<-list(unlist(dimnames(M)),unlist(dimnames(M)))
  if(!is.null(clu)) {
    clu<-lapply(clu,function(x)as.numeric(as.factor(x)))
    clu[[2]]<-clu[[2]]+max(clu[[1]])
    clu<-unlist(clu)
  }
 return(list(M=M1,clu=clu))
}

Try the blockmodelingOld package in your browser

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

blockmodelingOld documentation built on May 2, 2019, 5:11 p.m.