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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: predict_diagram_kpca
> ### Title: Project persistence diagrams into a low-dimensional space via a
> ###   pre-computed kernel PCA embedding.
> ### Aliases: predict_diagram_kpca
> 
> ### ** Examples
> 
> 
> if(require("TDAstats"))
+ {
+   # create six diagrams
+   D1 <- TDAstats::calculate_homology(TDAstats::circle2d[sample(1:100,20),],
+                       dim = 1,threshold = 2)
+   D2 <- TDAstats::calculate_homology(TDAstats::circle2d[sample(1:100,20),],
+                       dim = 1,threshold = 2)
+   D3 <- TDAstats::calculate_homology(TDAstats::sphere3d[sample(1:100,20),],
+                       dim = 1,threshold = 2)
+   D4 <- TDAstats::calculate_homology(TDAstats::sphere3d[sample(1:100,20),],
+                       dim = 1,threshold = 2)
+   D5 <- TDAstats::calculate_homology(TDAstats::sphere3d[sample(1:100,20),],
+                       dim = 1,threshold = 2)
+   D6 <- TDAstats::calculate_homology(TDAstats::sphere3d[sample(1:100,20),],
+                       dim = 1,threshold = 2)
+   g <- list(D1,D2,D3,D4,D5,D6)
+ 
+   # calculate their 2D PCA embedding with sigma = t = 2 in dimension 0
+   pca <- diagram_kpca(diagrams = g,dim = 1,t = 2,sigma = 2,
+                       features = 2,num_workers = 2,th = 1e-6)
+ 
+   # project two new diagrams onto old model
+   D7 <- TDAstats::calculate_homology(TDAstats::circle2d[sample(1:100,50),],
+                                      dim = 0,threshold = 2)
+   D8 <- TDAstats::calculate_homology(TDAstats::circle2d[sample(1:100,50),],
+                                      dim = 0,threshold = 2)
+   g_new <- list(D7,D8)
+ 
+   # calculate new embedding coordinates
+   new_pca <- predict_diagram_kpca(new_diagrams = g_new,embedding = pca,num_workers = 2)
+   
+   # repeat with precomputed Gram matrix, gives same result but much faster
+   K <- gram_matrix(diagrams = g_new,other_diagrams = pca$diagrams,dim = pca$dim,
+                    t = pca$t,sigma = pca$sigma,num_workers = 2)
+   new_pca <- predict_diagram_kpca(K = K,embedding = pca,num_workers = 2)
+ }
Loading required package: TDAstats

Attaching package: ‘TDAstats’

The following object is masked from ‘package:TDApplied’:

    permutation_test

Error in serverSocket(port = port) : 
  creation of server socket failed: port 11778 cannot be opened
Calls: gram_matrix ... distance_matrix -> <Anonymous> -> makePSOCKcluster -> serverSocket
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
                             user system elapsed
permutation_model_inference 0.682  0.145  16.243
diagram_kkmeans             0.229  0.088   5.557
predict_diagram_kkmeans     0.112  0.017   9.679
distance_matrix             0.119  0.008   6.035
independence_test           0.104  0.008   5.220