dist_wrt_centers {svs} | R Documentation |
Compute Distances with respect to Cluster Centers
Description
A function for computing (euclidean) distances with respect to specified cluster centers.
Usage
dist_wrt_centers(x, clusters, freq = NULL, members_only = TRUE)
Arguments
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. |
Value
A list with a matrix of distances for every cluster.
See Also
Examples
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]))
[Package svs version 3.1.1 Index]