Running examples in ‘dtwclust-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: tsclust
> ### Title: Time series clustering
> ### Aliases: tsclust
> 
> ### ** Examples
> 
> #' NOTE: More examples are available in the vignette. Here are just some miscellaneous
> #' examples that might come in handy. They should all work, but some don't run
> #' automatically.
> 
> # Load data
> data(uciCT)
> 
> # ====================================================================================
> # Simple partitional clustering with Euclidean distance and PAM centroids
> # ====================================================================================
> 
> # Reinterpolate to same length
> series <- reinterpolate(CharTraj, new.length = max(lengths(CharTraj)))
> 
> # Subset for speed
> series <- series[1:20]
> labels <- CharTrajLabels[1:20]
> 
> # Making many repetitions
> pc.l2 <- tsclust(series, k = 4L,
+                  distance = "L2", centroid = "pam",
+                  seed = 3247, trace = TRUE,
+                  control = partitional_control(nrep = 10L))

	Precomputing distance matrix...

Repetition 1 for k = 4
Iteration 1: Changes / Distsum = 20 / 106.6446
Iteration 2: Changes / Distsum =  2 / 53.2297
Iteration 3: Changes / Distsum =  0 / 49.6027

Repetition 2 for k = 4
Iteration 1: Changes / Distsum = 20 / 130.5215
Iteration 2: Changes / Distsum = 0 / 116.7966

Repetition 3 for k = 4
Iteration 1: Changes / Distsum = 20 / 106.2209
Iteration 2: Changes / Distsum = 0 / 99.09456

Repetition 4 for k = 4
Iteration 1: Changes / Distsum = 20 / 82.09483
Iteration 2: Changes / Distsum =  1 / 68.2079
Iteration 3: Changes / Distsum =  0 / 68.2079

Repetition 5 for k = 4
Iteration 1: Changes / Distsum = 20 / 84.34789
Iteration 2: Changes / Distsum = 2 / 50.56039
Iteration 3: Changes / Distsum =  0 / 49.6027

Repetition 6 for k = 4
Iteration 1: Changes / Distsum = 20 / 76.41461
Iteration 2: Changes / Distsum =  2 / 49.6027
Iteration 3: Changes / Distsum =  0 / 49.6027

Repetition 7 for k = 4
Iteration 1: Changes / Distsum = 20 / 78.83074
Iteration 2: Changes / Distsum =  2 / 49.6027
Iteration 3: Changes / Distsum =  0 / 49.6027

Repetition 8 for k = 4
Iteration 1: Changes / Distsum = 20 / 74.16051
Iteration 2: Changes / Distsum =  1 / 49.6027
Iteration 3: Changes / Distsum =  0 / 49.6027

Repetition 9 for k = 4
Iteration 1: Changes / Distsum = 20 / 77.99961
Iteration 2: Changes / Distsum = 2 / 50.56039
Iteration 3: Changes / Distsum =  0 / 49.6027

Repetition 10 for k = 4
Iteration 1: Changes / Distsum = 20 / 101.6274
Iteration 2: Changes / Distsum = 0 / 101.1829

	Elapsed time is 0.187 seconds.

> 
> # Cluster validity indices
> sapply(pc.l2, cvi, b = labels)
               [,1]         [,2]         [,3]         [,4]         [,5]
ARI    1.000000e+00 0.2002053388 6.149546e-01 6.149546e-01 1.000000e+00
RI     1.000000e+00 0.5684210526 8.473684e-01 8.473684e-01 1.000000e+00
J      1.000000e+00 0.2869565217 5.538462e-01 5.538462e-01 1.000000e+00
FM     1.000000e+00 0.5020790110 7.287987e-01 7.287987e-01 1.000000e+00
VI     0.000000e+00 0.4610152539 2.048455e-01 2.048455e-01 0.000000e+00
Sil    6.331221e-01 0.3119630506 3.149087e-01 5.346690e-01 6.331221e-01
SF     4.606696e-04 0.0003004822 1.752593e-05 3.238172e-04 4.606696e-04
CH     1.925006e+01 3.1947649639 5.413882e+00 1.258269e+01 1.925006e+01
DB     4.615583e-01 0.5873421456 1.130403e+00 5.573207e-01 4.615583e-01
DBstar 6.271176e-01 1.7248522405 1.580351e+00 8.294109e-01 6.271176e-01
D      7.808069e-01 0.1689797902 2.655638e-01 5.926710e-01 7.808069e-01
COP    1.207865e-01 0.4285157845 3.098501e-01 1.886585e-01 1.207865e-01
               [,6]         [,7]         [,8]         [,9]        [,10]
ARI    1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 5.819730e-01
RI     1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 8.368421e-01
J      1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 5.230769e-01
FM     1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 6.998789e-01
VI     0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 2.235863e-01
Sil    6.331221e-01 6.331221e-01 6.331221e-01 6.331221e-01 2.417737e-01
SF     4.606696e-04 4.606696e-04 4.606696e-04 4.606696e-04 4.195698e-06
CH     1.925006e+01 1.925006e+01 1.925006e+01 1.925006e+01 5.270039e+00
DB     4.615583e-01 4.615583e-01 4.615583e-01 4.615583e-01 1.321109e+00
DBstar 6.271176e-01 6.271176e-01 6.271176e-01 6.271176e-01 2.252835e+00
D      7.808069e-01 7.808069e-01 7.808069e-01 7.808069e-01 1.623149e-01
COP    1.207865e-01 1.207865e-01 1.207865e-01 1.207865e-01 3.113853e-01
> 
> # ====================================================================================
> # Hierarchical clustering with Euclidean distance
> # ====================================================================================
> 
> # Re-use the distance matrix from the previous example (all matrices are the same)
> # Use all available linkage methods for function hclust
> hc.l2 <- tsclust(series, type = "hierarchical",
+                  k = 4L, trace = TRUE,
+                  control = hierarchical_control(method = "all",
+                                                 distmat = pc.l2[[1L]]@distmat))

Distance matrix provided...
Performing hierarchical clustering...
Extracting centroids...

Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
	Elapsed time is 0.21 seconds.

> 
> # Plot the best dendrogram according to variation of information
> plot(hc.l2[[which.min(sapply(hc.l2, cvi, b = labels, type = "VI"))]])
Found more than one class "hclust" in cache; using the first, from namespace 'flexclust'
Also defined by ‘dtwclust’
Error in plot.hclust(x, ...) : invalid dendrogram
Calls: plot -> plot -> .local -> <Anonymous> -> plot.hclust
Execution halted