Description Usage Arguments Value Author(s) Examples

Compute the Mahalanobis distance of all pairwise rows in `.means`

. The
result is a symmetric matrix containing the distances that may be used for
hierarchical clustering.

1 |

`.means` |
A matrix of data with, say, p columns. |

`covar` |
The covariance matrix. |

`inverted` |
Logical argument. If |

A symmetric matrix with the Mahalanobis' distance.

Tiago Olivoto tiagoolivoto@gmail.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
library(metan)
library(dplyr)
# Compute the mean for genotypes
means <- means_by(data_ge, GEN) %>%
column_to_rownames("GEN")
# Compute the covariance matrix
covmat <- cov(means)
# Compute the distance
dist <- mahala(means, covmat)
# Dendrogram
dend <- dist %>%
as.dist() %>%
hclust() %>%
as.dendrogram()
plot(dend)
``` |

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.