R/mat2df.R

Defines functions mat2df

#function to flatten correlation matrix
mat2df <- function(cormat, pmat) {
  ut <- upper.tri(cormat)
  data.frame(
    Pos1 = rownames(cormat)[row(cormat)[ut]],
    Pos2 = rownames(cormat)[col(cormat)[ut]],
    cor  =(cormat)[ut],
    p = pmat[ut]
  )
}

Try the aaSEA package in your browser

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

aaSEA documentation built on Nov. 9, 2019, 5:07 p.m.