dist_wrt_centers | R Documentation |
A function for computing (euclidean) distances with respect to specified cluster centers.
dist_wrt_centers(x, clusters, freq = NULL, members_only = TRUE)
x |
A numeric matrix (containing coordinates). |
clusters |
A clustering of the row levels of |
freq |
An optional vector of frequency counts for the row levels of |
members_only |
Logical specifying whether the distances from the cluster centers should only be computed for the cluster members. |
A list with a matrix of distances for every cluster.
centers_ca
, freq_ca
.
SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8",
stringsAsFactors = FALSE)
sca_SndT_Fra <- fast_sca(SndT_Fra)
kcl_SndT_Fra <- kmeans(sca_SndT_Fra$pos1, centers = 7)
dist_wrt_centers(sca_SndT_Fra$pos1, clusters = kcl_SndT_Fra, freq = freq_ca(SndT_Fra[, 1]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.