R/seqDiff.R

Defines functions seqDiff

Documented in seqDiff

#This is a function to calculate deviation between two graphs represented by two sequences

seqDiff <- function(g1, g2){
  
  #Convert binary to decimal for g1 (truth)
  G1 <- as.vector(t(g1))
  G11 <- paste(G1,collapse="")
  S1 <- compositions::unbinary(G11)
  
  #Convert binary to decimal for g2 (inferred)
  G2 <- as.vector(t(g2))
  G22 <- paste(G2,collapse="")
  S2 <- compositions::unbinary(G22)
  
  #Deviation of the inferred from the truth
  seqDiff <- S2-S1
  return(seqDiff)
}
audreyqyfu/mrpc2 documentation built on April 17, 2022, 7:36 a.m.