Running 'onecluster.R' [165s]
  Running 'typic_analysis.R' [163s]
Running the tests in 'tests/onecluster.R' failed.
Complete output:
  > library(WeightedCluster)
  Loading required package: TraMineR
  
  TraMineR stable version 2.2-9 (Built: 2024-03-23)
  Website: http://traminer.unige.ch
  Please type 'citation("TraMineR")' for citation information.
  
  Loading required package: cluster
  This is WeightedCluster stable version 1.6-4 (Built: 2024-03-23)
  
  To get the manuals, please run:
     vignette("WeightedCluster") ## Complete manual in English
     vignette("WeightedClusterFR") ## Complete manual in French
     vignette("WeightedClusterPreview") ## Short preview in English
  
  To cite WeightedCluster in publications please use:
  Studer, Matthias (2013). WeightedCluster Library Manual: A practical
     guide to creating typologies of trajectories in the social sciences
     with R. LIVES Working Papers, 24. doi:
     10.12682/lives.2296-1658.2013.24
  > data(mvad)
  > library(RUnit)
  > 
  > ## Aggregating state sequence
  > aggMvad <- wcAggregateCases(mvad[1:10, 17:86], weights=mvad$weight[1:10])
  > 
  > ## Creating state sequence object
  > mvad.seq <- seqdef(mvad[aggMvad$aggIndex, 17:86], weights=aggMvad$aggWeights)
   [>] 6 distinct states appear in the data: 
       1 = FE
       2 = HE
       3 = employment
       4 = joblessness
       5 = school
       6 = training
   [>] state coding:
         [alphabet]  [label]     [long label] 
       1  FE          FE          FE
       2  HE          HE          HE
       3  employment  employment  employment
       4  joblessness joblessness joblessness
       5  school      school      school
       6  training    training    training
   [>] sum of weights: 15.16 - min/max: 0.33/3.6
   [>] 10 sequences in the data set
   [>] min/max sequence length: 70/70
  > ## Computing Hamming distance between sequence
  > diss <- seqdist(mvad.seq, method="HAM")
   [>] 10 sequences with 6 distinct states
   [>] creating a 'sm' with a single substitution cost of 1
   [>] creating 6x6 substitution-cost matrix using 1 as constant value
   [>] 10 distinct  sequences 
   [>] min/max sequence lengths: 70/70
   [>] computing distances using the HAM metric
   [>] elapsed time: 0.07 secs
  > clust4 <- wcKMedoids(diss, k=4, weights=aggMvad$aggWeights, cluster.only=TRUE)
  > dissd <- seqdist(mvad.seq, method="HAM", full.matrix=FALSE)
   [>] 10 sequences with 6 distinct states
   [>] creating a 'sm' with a single substitution cost of 1
   [>] creating 6x6 substitution-cost matrix using 1 as constant value
   [>] 10 distinct  sequences 
   [>] min/max sequence lengths: 70/70
   [>] computing distances using the HAM metric
   [>] elapsed time: 0.06 secs
  > clust4d <- wcKMedoids(dissd, k=4, weights=aggMvad$aggWeights, cluster.only=TRUE)
  > #clust4d <- wcKMedoids(diss, k=4, weights=aggMvad$aggWeights,debuglevel=11)
  > checkEquals(clust4, clust4d)
  [1] TRUE
  > 
  > 
  > 
  > 
  > ## Compute the silhouette of each observation
  > clust1 <- rep(1, nrow(mvad.seq))
  > checkException(qual <- wcClusterQuality(diss, clust1, weights=aggMvad$aggWeights))
  Error in wcClusterQualityInternal(diss = diss, clustering = clustering,  : 
    [!] The clustering should have at least two different values.
  [1] TRUE
  > 
  > ## Compute the silhouette of each observation
  > checkException(sil <- wcSilhouetteObs(diss, clust1, weights=aggMvad$aggWeights))
  Error in wcSilhouetteObs(diss, clust1, weights = aggMvad$aggWeights) : 
    [!] The clustering should have at least two different values.
  [1] TRUE
  > 
  > qual1 <- wcClusterQuality(diss, clust4, weights=aggMvad$aggWeights)
  > qual2 <- wcClusterQuality(dissd, clust4, weights=aggMvad$aggWeights)
  > checkEquals(qual1, qual2)
  [1] TRUE
  > 
  > sil1 <- wcSilhouetteObs(diss, clust4, weights=aggMvad$aggWeights)
  > sil2 <- wcSilhouetteObs(dissd, clust4, weights=aggMvad$aggWeights)
  > checkEquals(sil1, sil2)
  [1] TRUE
  > 
  > proc.time()
     user  system elapsed 
     1.96    0.28    2.23 
Running the tests in 'tests/typic_analysis.R' failed.
Complete output:
  > library(WeightedCluster)
  Loading required package: TraMineR
  
  TraMineR stable version 2.2-9 (Built: 2024-03-23)
  Website: http://traminer.unige.ch
  Please type 'citation("TraMineR")' for citation information.
  
  Loading required package: cluster
  This is WeightedCluster stable version 1.6-4 (Built: 2024-03-23)
  
  To get the manuals, please run:
     vignette("WeightedCluster") ## Complete manual in English
     vignette("WeightedClusterFR") ## Complete manual in French
     vignette("WeightedClusterPreview") ## Short preview in English
  
  To cite WeightedCluster in publications please use:
  Studer, Matthias (2013). WeightedCluster Library Manual: A practical
     guide to creating typologies of trajectories in the social sciences
     with R. LIVES Working Papers, 24. doi:
     10.12682/lives.2296-1658.2013.24
  > data(mvad)
  > 
  > 
  > ## Aggregating state sequence
  > aggMvad <- wcAggregateCases(mvad[, 17:86], weights=mvad$weight)
  > 
  > ## Creating state sequence object
  > mvad.seq <- seqdef(mvad[aggMvad$aggIndex, 17:86], weights=aggMvad$aggWeights)
   [>] 6 distinct states appear in the data: 
       1 = FE
       2 = HE
       3 = employment
       4 = joblessness
       5 = school
       6 = training
   [>] state coding:
         [alphabet]  [label]     [long label] 
       1  FE          FE          FE
       2  HE          HE          HE
       3  employment  employment  employment
       4  joblessness joblessness joblessness
       5  school      school      school
       6  training    training    training
   [>] sum of weights: 711.57 - min/max: 0.13/33.43
   [>] 490 sequences in the data set
   [>] min/max sequence length: 70/70
  > ## Computing Hamming distance between sequence
  > diss <- seqdist(mvad.seq, method="HAM")
   [>] 490 sequences with 6 distinct states
   [>] creating a 'sm' with a single substitution cost of 1
   [>] creating 6x6 substitution-cost matrix using 1 as constant value
   [>] 490 distinct  sequences 
   [>] min/max sequence lengths: 70/70
   [>] computing distances using the HAM metric
   [>] elapsed time: 0.24 secs
  > 
  > 
  > averageClust <- hclust(as.dist(diss), method="average", members=aggMvad$aggWeights)
  > 
  > avgClustQual <- as.clustrange(averageClust, diss, weights=aggMvad$aggWeights, ncluster=20)
  There were 16 warnings (use warnings() to see them)
  > 
  > wardClust <- hclust(as.dist(diss), method="ward", members=aggMvad$aggWeights)
  The "ward" method has been renamed to "ward.D"; note new "ward.D2"
  > 
  > wardClustQual <- as.clustrange(wardClust, diss, weights=aggMvad$aggWeights, ncluster=20)
  > 
  > kmedClustQual <- wcKMedRange(diss, kvals=2:20, weights=aggMvad$aggWeights)
  > 
  > kmedwardClustQual <- wcKMedRange(diss, kvals=2:20, weights=aggMvad$aggWeights, initialclust=wardClust)
  > 
  > 
  > print(summary(avgClustQual, max.rank=3), digits=2)
       1. N groups 1.  stat 2. N groups 2.  stat 3. N groups 3.  stat
  PBC           13    0.762          14    0.762          15    0.762
  HG            20    0.915          19    0.915          18    0.912
  HGSD          20    0.912          19    0.912          18    0.909
  ASW            4    0.418           3    0.393           2    0.390
  ASWw           4    0.421           5    0.404           6    0.400
  CH             2  222.811           4  149.657           3  149.253
  R2            20    0.501          19    0.498          18    0.489
  CHsq           2  402.652           4  342.206           3  294.375
  R2sq          20    0.722          19    0.720          18    0.710
  HC            20    0.051          19    0.051          18    0.053
  > print(summary(wardClustQual, max.rank=3), digits=2)
       1. N groups 1.  stat 2. N groups 2.  stat 3. N groups 3.  stat
  PBC            4    0.719           5    0.708           3     0.67
  HG            17    0.909          20    0.904          19     0.90
  HGSD          17    0.907          20    0.901          19     0.90
  ASW            4    0.403           3    0.379           5     0.36
  ASWw           4    0.406           3    0.382           5     0.36
  CH             2  189.201           3  174.345           4   147.29
  R2            20    0.658          19    0.653          18     0.65
  CHsq           3  344.932           2  332.359           4   328.77
  R2sq          20    0.834          19    0.831          18     0.83
  HC            17    0.075           5    0.078          16     0.08
  > print(summary(kmedClustQual, max.rank=3), digits=2)
       1. N groups 1.  stat 2. N groups 2.  stat 3. N groups 3.  stat
  PBC            2    0.641           3    0.629           5    0.610
  HG            20    0.906          19    0.900          14    0.895
  HGSD          20    0.903          19    0.897          14    0.892
  ASW            2    0.409          10    0.372           8    0.368
  ASWw           2    0.411          10    0.381           8    0.375
  CH             2  240.196           3  169.209           4  137.052
  R2            20    0.686          19    0.677          18    0.671
  CHsq           2  474.865           3  343.526           8  306.740
  R2sq          20    0.859          19    0.853          18    0.848
  HC            20    0.083          10    0.084          14    0.086
  > print(summary(kmedwardClustQual, max.rank=3), digits=2)
       1. N groups 1.  stat 2. N groups 2.  stat 3. N groups 3.  stat
  PBC            2    0.649           3    0.628           5    0.605
  HG            20    0.905          16    0.903          19    0.900
  HGSD          20    0.902          16    0.901          19    0.897
  ASW            2    0.404          10    0.370          16    0.356
  ASWw           2    0.405          10    0.379          20    0.372
  CH             2  235.371           3  167.423           4  136.078
  R2            20    0.685          19    0.678          18    0.673
  CHsq           2  464.680           3  339.263           5  307.353
  R2sq          20    0.858          19    0.854          18    0.849
  HC            16    0.081          20    0.084          10    0.085
  > 
  > plot(wardClustQual, stat = c("ASWw", "HG", "PBC", "HC"))
  > avg4Medoids <- disscenter(diss, group=avgClustQual$clustering$cluster4, weights=aggMvad$aggWeights, medoids.index="first")
  > 
  > final <- wcKMedoids(diss, k=4, weights=aggMvad$aggWeights, initialclust=avgClustQual$clustering$cluster4)
  > final2 <- wcKMedoids(diss, k=4, weights=aggMvad$aggWeights, initialclust=avg4Medoids)
  > all.equal(final, final2)
  [1] TRUE
  > final2
  Cluster quality:
         PBC        HG      HGSD      ASW      ASWw       CH        R2     CHsq
   0.7073574 0.8506705 0.8463891 0.382927 0.3865362 151.8857 0.3917181 349.3422
        R2sq        HC
   0.5969632 0.0875719
  
  Per cluster Weighted Average Silhouette Width:
          28       141       398       450
   0.5319309 0.1548776 0.3907976 0.3161458
   0.5341768 0.1610683 0.3927098 0.3286968
  > 
  > 
  > ## Compute the silhouette of each observation
  > qual <- wcClusterQuality(diss, avgClustQual$clustering$cluster4, weights=aggMvad$aggWeights)
  > 
  > ## Compute the silhouette of each observation
  > sil <- wcSilhouetteObs(diss, avgClustQual$clustering$cluster4, weights=aggMvad$aggWeights)
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     3.35    0.31    3.65