distmy: distance among matrix columns with freely choosable distance...

Description Usage Arguments Value Examples

View source: R/distmy.R

Description

distance among matrix columns with freely choosable distance function

Usage

1
distmy(x, func, init = NA, diag = TRUE)

Arguments

x

data

func

function taking 2 arrays x, y

init

how to initialize the output matrix

diag

should the diagonal be also computed

Value

matrix with dist[i,j] = func(x[,i],[x,j])

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mat = matrix(rnorm(10*5000),ncol=10)
redist = distmy(mat,function(x,y){mean(abs(x-y))},init=NA,diag=FALSE)
image(redist)
redist = distmy(mat,cor,init=0,diag=FALSE)
image(redist)
redist = distmy(mat,function(x,y){ks.test(x,y)$p.value},init=1,diag=TRUE)
image(redist)
hist(uppertriang(redist))
range(uppertriang(redist))
which(redist < 0.05 , arr.ind = TRUE)

quantable documentation built on May 2, 2019, 4:05 p.m.

Related to distmy in quantable...