update.hier_clust | R Documentation |
If parameters of a cluster specification need to be modified,
update()
can be used in lieu of recreating the object from scratch.
## S3 method for class 'hier_clust'
update(
object,
parameters = NULL,
num_clusters = NULL,
cut_height = NULL,
linkage_method = NULL,
fresh = FALSE,
...
)
## S3 method for class 'k_means'
update(object, parameters = NULL, num_clusters = NULL, fresh = FALSE, ...)
object |
A cluster specification. |
parameters |
A 1-row tibble or named list with main parameters to
update. Use either |
num_clusters |
Positive integer, number of clusters in model. |
cut_height |
Positive double, height at which to cut dendrogram to
obtain cluster assignments (only used if |
linkage_method |
the agglomeration method to be used. This should be (an
unambiguous abbreviation of) one of |
fresh |
A logical for whether the arguments should be modified in-place or replaced wholesale. |
... |
Not used for |
An updated cluster specification.
kmeans_spec <- k_means(num_clusters = 5)
kmeans_spec
update(kmeans_spec, num_clusters = 1)
update(kmeans_spec, num_clusters = 1, fresh = TRUE)
param_values <- tibble::tibble(num_clusters = 10)
kmeans_spec %>% update(param_values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.