Description Usage Arguments Value Examples

distance among matrix columns with freely choosable distance function

1 |

`x` |
data |

`func` |
function taking 2 arrays x, y |

`init` |
how to initialize the output matrix |

`diag` |
should the diagonal be also computed |

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

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 16, 2018, 1:04 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.