get_dist: Enhanced Distance Matrix Computation and Visualization

View source: R/diff_utils.R

get_distR Documentation

Enhanced Distance Matrix Computation and Visualization

Description

Clustering methods classify data samples into groups of similar objects. This process requires some methods for measuring the distance or the (dis)similarity between the observations. Read more: STHDA website - clarifying distance measures..

  • get_dist(): Computes a distance matrix between the rows of a data matrix. Compared to the standard dist() function, it supports correlation-based distance measures including "pearson", "kendall" and "spearman" methods.

  • fviz_dist(): Visualizes a distance matrix

Usage

get_dist(x, method = "euclidean", stand = FALSE, ...)

Arguments

x

a numeric matrix or a data frame.

method

the distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski", "pearson", "spearman" or "kendall".

stand

logical value; default is FALSE. If TRUE, then the data will be standardized using the function scale(). Measurements are standardized for each variable (column), by subtracting the variable's mean value and dividing by the variable's standard deviation.

...

other arguments to be passed to the function dist() when using get_dist().

Value

  • get_dist(): returns an object of class "dist".

  • fviz_dist(): returns a ggplot2

Author(s)

Alboukadel Kassambara alboukadel.kassambara@gmail.com

See Also

dist

Examples

data(USArrests)
res.dist <- dseqr:::get_dist(USArrests, stand = TRUE, method = "pearson")

hms-dbmi/drugseqr documentation built on Feb. 15, 2024, 10:38 p.m.