We are hiring ! See our job offers.
Raw File
Tip revision: b6ad4d474d5865090b0bfabf2570aa79580237a4 authored by Manuela Hummel on 16 May 2017, 09:19:23 UTC
version 2.0
Tip revision: b6ad4d4
dist.variables <-
function(data, method=c("associationMeasures", "distcor"), associationFun=association, check.psd=TRUE){
# data: data.frame of original data 
# method: method to calculate distances: combination of association measures ("associationMeasures") or distance correlation ("distcor")
# associationFun: function that calculates association measure for each pair of variables in case of method="association"
# check.psd: check if resulting similarity matrix S is positive semi-definite?

  method <- match.arg(method)
  if(method == "associationMeasures"){
    S <- similarity.variables(data, associationFun=associationFun, check.psd=check.psd)
    D <- as.dist(sqrt(1 - S))
  else if(method == "distcor")
    D <- dcor_dist_bc(data)
back to top