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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: DataSimilarity
> ### Title: Dataset Similarity
> ### Aliases: DataSimilarity
> 
> ### ** Examples
> 
> # Workflow for using the DataSimilarity package: 
> # Prepare data example: comparing species in iris dataset
> data("iris")
> iris.split <- split(iris[, -5], iris$Species)
> setosa <- iris.split$setosa
> versicolor <- iris.split$versicolor
> virginica <- iris.split$virginica
> 
> # 1. Find appropriate methods that can be used to compare 3 numeric datasets:
> findSimilarityMethod(Numeric = TRUE, Multiple.Samples = TRUE)
 [1] "BallDivergence" "C2ST"           "DISCOB"         "DISCOF"        
 [5] "Energy"         "FStest"         "KMD"            "MMCM"          
 [9] "MW"             "Petrie"         "RItest"         "SC"            
> 
> # get more information 
> findSimilarityMethod(Numeric = TRUE, Multiple.Samples = TRUE, only.names = FALSE)
                                    Method Implementation Target.Inclusion
2                        Pan et al. (2018) BallDivergence      Unfulfilled
7         C2ST (Lopez-Paz and Oquab, 2017)           C2ST      Unfulfilled
15         DISCO (Rizzo and Székely, 2010)         DISCOB      Unfulfilled
16         DISCO (Rizzo and Székely, 2010)         DISCOF      Unfulfilled
18 Energy statistic (Zech and Aslan, 2003)         Energy      Unfulfilled
22               Paul, De and Ghosh (2022)         FStest      Unfulfilled
27               KMD (Huang and Sen, 2023)            KMD      Unfulfilled
29                 Mukherjee et al. (2022)           MMCM      Unfulfilled
31            Mukhopadhyay and Wang (2020)             MW      Unfulfilled
34                           Petrie (2016)         Petrie      Unfulfilled
35               Paul, De and Ghosh (2022)         RItest      Unfulfilled
37                    Song and Chen (2022)             SC      Unfulfilled
     Numeric             Categorical Unequal.Sample.Sizes
2  Fulfilled             Unfulfilled            Fulfilled
7  Fulfilled Conditionally Fulfilled            Fulfilled
15 Fulfilled             Unfulfilled            Fulfilled
16 Fulfilled             Unfulfilled            Fulfilled
18 Fulfilled             Unfulfilled            Fulfilled
22 Fulfilled             Unfulfilled            Fulfilled
27 Fulfilled             Unfulfilled            Fulfilled
29 Fulfilled               Fulfilled            Fulfilled
31 Fulfilled             Unfulfilled            Fulfilled
34 Fulfilled               Fulfilled            Fulfilled
35 Fulfilled             Unfulfilled            Fulfilled
37 Fulfilled             Unfulfilled            Fulfilled
                p.Larger.N Multiple.Samples Without.training No.assumptions
2                Fulfilled        Fulfilled        Fulfilled      Fulfilled
7  Conditionally Fulfilled        Fulfilled      Unfulfilled    Unfulfilled
15               Fulfilled        Fulfilled        Fulfilled    Unfulfilled
16               Fulfilled        Fulfilled        Fulfilled    Unfulfilled
18               Fulfilled        Fulfilled        Fulfilled    Unfulfilled
22               Fulfilled        Fulfilled        Fulfilled      Fulfilled
27               Fulfilled        Fulfilled        Fulfilled      Fulfilled
29               Fulfilled        Fulfilled        Fulfilled    Unfulfilled
31               Fulfilled        Fulfilled        Fulfilled    Unfulfilled
34               Fulfilled        Fulfilled        Fulfilled    Unfulfilled
35               Fulfilled        Fulfilled        Fulfilled      Fulfilled
37               Fulfilled        Fulfilled        Fulfilled    Unfulfilled
   No.parameters Implemented                     Complexity Interpretable.units
2    Unfulfilled   Fulfilled                           <NA>         Unfulfilled
7    Unfulfilled   Fulfilled                           <NA>           Fulfilled
15   Unfulfilled   Fulfilled                         O(N^2)         Unfulfilled
16   Unfulfilled   Fulfilled                         O(N^2)         Unfulfilled
18     Fulfilled   Fulfilled                         O(N^2)         Unfulfilled
22   Unfulfilled   Fulfilled                           <NA>         Unfulfilled
27   Unfulfilled   Fulfilled                    O(KN log N)         Unfulfilled
29     Fulfilled   Fulfilled                           <NA>         Unfulfilled
31   Unfulfilled   Fulfilled                           <NA>         Unfulfilled
34   Unfulfilled   Fulfilled O(N^2 log N),O(N^3),O(N log N)           Fulfilled
35   Unfulfilled   Fulfilled                           <NA>         Unfulfilled
37   Unfulfilled   Fulfilled                           <NA>         Unfulfilled
   Lower.bound Upper.bound      Rotation.invariant Location.change.invariant
2            0        <NA>                    <NA>                      <NA>
7            0           1 Conditionally Fulfilled   Conditionally Fulfilled
15           0 Unfulfilled               Fulfilled                 Fulfilled
16           0 Unfulfilled               Fulfilled                 Fulfilled
18           0 Unfulfilled               Fulfilled                 Fulfilled
22           0           1 Conditionally Fulfilled   Conditionally Fulfilled
27           0           1               Fulfilled                 Fulfilled
29           0        <NA>               Fulfilled                 Fulfilled
31           0        <NA>                    <NA>                      <NA>
34   Fulfilled   Fulfilled               Fulfilled                 Fulfilled
35           0           1 Conditionally Fulfilled   Conditionally Fulfilled
37           0        <NA>               Fulfilled                 Fulfilled
   Homogeneous.scale.invariant Positive.definite Symmetric Triangle.inequality
2                         <NA>         Fulfilled Fulfilled         Unfulfilled
7      Conditionally Fulfilled              <NA> Fulfilled                <NA>
15                 Unfulfilled              <NA> Fulfilled                <NA>
16                 Unfulfilled              <NA> Fulfilled                <NA>
18                 Unfulfilled         Fulfilled Fulfilled           Fulfilled
22                        <NA>              <NA> Fulfilled                <NA>
27                   Fulfilled         Fulfilled Fulfilled                <NA>
29                   Fulfilled              <NA> Fulfilled                <NA>
31                        <NA>              <NA> Fulfilled                <NA>
34                   Fulfilled              <NA> Fulfilled                <NA>
35                        <NA>              <NA> Fulfilled                <NA>
37                   Fulfilled              <NA> Fulfilled                <NA>
             Consistency.N           Consistency.p Number.Fulfilled
2                Fulfilled                    <NA>               11
7  Conditionally Fulfilled                    <NA>                7
15               Fulfilled                    <NA>               11
16               Fulfilled                    <NA>               11
18               Fulfilled Conditionally Fulfilled               14
22                    <NA>               Fulfilled               11
27               Fulfilled                    <NA>               16
29               Fulfilled                    <NA>               14
31                    <NA>                    <NA>                9
34                    <NA>                    <NA>               13
35                    <NA>               Fulfilled               11
37               Fulfilled                    <NA>               12
   Number.Cond.Fulfilled Number.Unfulfilled Number.NA
2                      0                  5         5
7                      6                  5         3
15                     0                  7         3
16                     0                  7         3
18                     1                  6         0
22                     3                  3         4
27                     0                  3         2
29                     0                  3         4
31                     0                  4         8
34                     0                  4         4
35                     3                  3         4
37                     0                  5         4
                                       Class
2                           Testing approach
7      Method based on binary classification
15 Comparison based on inter-point distances
16 Comparison based on inter-point distances
18 Comparison based on inter-point distances
22                          Testing approach
27                              Kernel-based
29                               Graph-based
31                               Graph-based
34                               Graph-based
35                          Testing approach
37                               Graph-based
                                    Subclass
2                           Testing approach
7      Method based on binary classification
15 Comparison based on inter-point distances
16 Comparison based on inter-point distances
18 Comparison based on inter-point distances
22                          Testing approach
27                              Kernel-based
29                               Graph-based
31                               Graph-based
34                               Graph-based
35                          Testing approach
37                               Graph-based
> 
> # 2. Choose a method and apply it:
> # All suitable methods
> possible.methds <- findSimilarityMethod(Numeric = TRUE, Multiple.Samples = TRUE, 
+                                           only.names = FALSE)
> # Select, e.g., method with highest number of fulfilled criteria
> possible.methds$Implementation[which.max(possible.methds$Number.Fulfilled)]
[1] "KMD"
> 
> set.seed(1234)
> if(requireNamespace("KMD")) {
+   DataSimilarity(setosa, versicolor, virginica, method = "KMD")
+ }
Loading required namespace: KMD
Error in `[.data.table`(df_X, , `:=`(gp_size, length(id)), by = "group") : 
  attempt access index 2/2 in VECTOR_ELT
Calls: DataSimilarity ... <Anonymous> -> <Anonymous> -> get_neighbors -> [ -> [.data.table
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
      user system elapsed
C2ST 4.594  0.226   6.344