R/targetG.R

Defines functions targetG

Documented in targetG

targetG <-
function(x,genegroups) {
  T1   <- target.help(genegroups)
  T2   <- matrix(nrow=length(genegroups),ncol=length(genegroups),data=0)
  corm <- T1*cor(x)
  diag(corm)<-0
  cora <-sum(colSums(corm))/sum(corm!=0)
  for (i in 1:length(genegroups)) {
    for (j in 1:i) {
      if (i!=j & T1[i,j]==1) T2[i,j] <- cora*(sd(x[,i])*sd(x[,j]))
      if (i==j)T2[i,j] <- cov(x[,i],x[,j])
      T2[j,i]<-T2[i,j]
      }
  }
  T2
}

Try the SHIP package in your browser

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

SHIP documentation built on May 1, 2019, 8:29 p.m.