View source: R/utils_clustering.R
compute_dmat | R Documentation |
This function applies scaling to the columns of a data frame and computes and returns a distance matrix from a chosen distance measure.
compute_dmat(
x,
dist_method = "euclidean",
apply_scaling = FALSE,
subset_cols = NULL
)
x |
a numeric data frame or matrix |
dist_method |
a distance measure to apply to the scaled data. Must be those supported by |
apply_scaling |
use TRUE to apply |
subset_cols |
(optional) a list of columns to subset the data |
an object of class "dist" (see stats::dist()
)
dmat <- compute_dmat(iris, "euclidean", TRUE, c("Petal.Length", "Sepal.Length"))
print(class(dmat))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.