merge_clusters | R Documentation |
Merge several clusters/states of an EMM into a single cluster/state.
## S4 method for signature 'EMM,character'
merge_clusters(x, to_merge, clustering = FALSE, new_center = NULL, copy=TRUE)
x |
an |
to_merge |
vector of names of the states/clusters to merge. The
name of the first state in |
clustering |
is |
new_center |
supply new centers for the merged clusters.
New centroids are automatically
computed. If (pseudo) medoids are used, new medoids should be supplied.
If none is supplied, the medoid of the cluster in |
copy |
logical; make a copy of x before reclustering? Otherwise the function will change |
Returns the changed EMM with the states/clusters merged invisibly.
If copy=FALSE
then it returns a reference to the changes
object passed as x
.
data("EMMTraffic")
emm <- EMM(measure="eJaccard", threshold=0.2)
build(emm, EMMTraffic)
states(emm)
## create a new emm with states 1-3 merged
emm_m123 <- merge_clusters(emm, c("1", "2", "3"))
states(emm_m123)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.