R/JaccardSM.R

Defines functions JaccardSM

Documented in JaccardSM

#' Calculates the Jaccard similarity matrix.
#' 
#' @param network1 first network matrix input
#' @param network2 second network matrix input
#' @return the alignment/co-occurene score

JaccardSM<-function(network1, network2){
  cooccur<-sum(network1+network2==2)
  activeNodes<-sum((network1+network2)>0)
  alignmentScore<-cooccur/activeNodes
  return(alignmentScore)
}

Try the PAC package in your browser

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

PAC documentation built on Feb. 18, 2021, 9:06 a.m.