File: one2two.R

package info (click to toggle)
r-cran-blockmodeling 1.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 912 kB
  • sloc: ansic: 2,024; f90: 952; sh: 13; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#' @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))
}