Assign a cluster to each observation of the entire dataset
assign_cluster.RdFunction to assign a cluster to each observation of the entire dataset by selecting the closest medoid
Usage
assign_cluster(
data,
metric,
medoids,
dist_matrix = NULL,
type = "hard",
m = 2,
data_medoids = NULL,
return_distMatrix = FALSE,
return_data_medoids = FALSE
)Arguments
- data
Entire data.frame
- metric
A character specifying a predefined dissimilarity metric (like
"euclidean"or"manhattan") or a self-defined dissimilarity function. Defaults to"euclidean". Will be passed as argumentmethodtodist, so check?proxy::distfor full details.- medoids
Medoids of the obtained clustering solution for the data sample
- dist_matrix
Optional dissimilarity matrix (defaults to NULL)
- type
One of
c("hard","fuzzy"), specifying the type of clustering to be performed.- m
Fuzziness exponent (only for
type = "fuzzy"), which has to be a numeric of minimum 1. Defaults to 2.- data_medoids
data.frame with variable information of medoids
- return_distMatrix
Indicator if the distances to the cluster medoids should be returned. Defaults to FALSE.
- return_data_medoids
Indicator if the medoid data should be returned. Defaults to FALSE.