R/cor2dist.R

"cor2dist" <- function(x) {
   if(dim(x)[1] != dim(x)[2]) {x <- cor(x,use="pairwise")}
   dist <-  sqrt(2*(1-x))
   return(dist)
   }

Try the psych package in your browser

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

psych documentation built on Sept. 26, 2023, 1:06 a.m.