dtwclust
dtwclust-class
objects.
"show"(object)
"update"(object, ..., evaluate = TRUE)
"update"(object, ..., evaluate = TRUE)
"predict"(object, newdata = NULL, ...)
"predict"(object, newdata = NULL, ...)
"plot"(x, y, ..., clus = seq_len(x@k), labs.arg = NULL, data = NULL, time = NULL, plot = TRUE, type = NULL)
"plot"(x, y, ..., clus = seq_len(x@k), labs.arg = NULL, data = NULL, time = NULL, plot = TRUE, type = NULL)
dtwclust-class
as returned by
dtwclust
.plot
, further arguments to pass to geom_line
for the
plotting of the cluster centroids, or to plot.hclust
. See details.
For update
, any supported argument. Otherwise ignored.TRUE
and evaluates the updated call, which will
result in a new dtwclust
object. Otherwise, it returns the unevaluated call.dtwclust
. Note that for multivariate series, this means that it must be
a list of matrices, even if the list has only one element.labs
for more informationdtwclust
.FALSE
in case you want to save the ggplot
object without printing anything to screenNULL
means default. See details.gg
object (or NULL
for dendrogram plot) invisibly.
ggplot2
plotting system (see ggplot
). The default depends on whether a hierarchical method was used or not. In those cases, the
dendrogram is plotted by default; you can pass any extra parameters to
plot.hclust
via ...
. Otherwise, the function plots the time series of each cluster along with the obtained centroid.
The default values for cluster centroids are: linetype = "dashed"
, size = 1.5
,
colour = "black"
, alpha = 0.5
. You can change this by means of ...
. You can choose what to plot with the type
parameter. Possible options are: "dendrogram"
: Only available for hierarchical clustering.
"series"
: Plot the time series divided into clusters without including centroids.
"centroids"
: Plot the obtained centroids only.
"sc"
: Plot both series and centroids
save.data
should be set to TRUE
when running dtwclust
to be
able to use this. Optionally, you can manually provide the data in the data
parameter. If created, the function returns the gg
object invisibly, in case you want to modify it to
your liking. You might want to look at ggplot_build
if that's the case. If you want to free the scale of the X axis, you can do the following: plot(object, plot = FALSE)
+
facet_wrap(~cl, scales = "free")
flexclust
package are: randIndex
and
clusterSim
.All generics from package clue are also supported in order to use its functions.
Show method displays basic information from the clustering results.
The update
method takes the original function call, replaces any provided argument and
optionally evaluates the call again. Use evaluate = FALSE
if you want to get the
unevaluated call.
The predict
generic can take the usual newdata
argument and it returns the
cluster(s) to which the data belongs; if NULL
, it simply returns the obtained cluster
indices. It preprocesses the data with the corresponding function if available.
dtwclust-class
, dtwclust
, ggplot
,
cvi