Performs clustra runs for several k and prepares silhouette
plot data. Computes a proxy silhouette index based on distances to cluster
centers rather than trajectory pairs. The cost is essentially that of
running clustra for several k as this information is available directly from
clustra. Can also reuse a previous clustra run and produce data for a single
silhouette plot.
clustra_sil(
data,
kv = NULL,
starts = "random",
mccores = 1,
maxdf = 30,
conv = c(10, 0),
save = FALSE,
verbose = FALSE
)Invisibly returns a list of length length(kv), where each element is
a matrix with nrow(data) rows and three columns cluster, neighbor,
silhouette. The matrix in each element of this list can be used to draw a
silhouette plot. When the input was a completed clustra run, the output is a
list with a single element for a single silhouette plot.
A data.frame (see the data parameter of trajectories).
Alternatively, the output from a completed clustra run can be used, in
which case kv is left as NULL. See Details.
Vector of clustra k values to run. If data is the output from a
completed clustra run, leave kv as NULL.
See clustra.
See trajectories.
Fitting parameters. See trajectories.
Fitting parameters. See trajectories.
Logical. When TRUE, save all results as file clustra_sil.Rdata.
Logical. When TRUE, information about each run of clustra is printed.
When given the raw data as the first parameter (input data parameter of
trajectories), kv specifies a vector of k parameters for
clustra and produces data for silhouette plots of each of them.
Alternatively, the input can be the output from a single clustra run, in
which case data for a single silhouette plot will be made without running
clustra.