... | ... |
@@ -1,5 +1,5 @@ |
1 |
-# A function to generate the radii values for the Gaussian kernel |
|
2 |
-# function was obtained from https://rdrr.io/rforge/yasomi/ with some major modifications |
|
1 |
+# A function to generate the radii values for the Gaussian kernel function was |
|
2 |
+# obtained from https://rdrr.io/rforge/yasomi/ with some major modifications |
|
3 | 3 |
|
4 | 4 |
radiusExp <- function(min, max, steps) { |
5 | 5 |
max * (min / max)^(seq(0, 1, length.out = steps)) |
... | ... |
@@ -1,11 +1,12 @@ |
1 | 1 |
# A function to estimate the number of clusters using the distance method |
2 | 2 |
# see https://arxiv.org/abs/1608.07494 |
3 |
-# function was obtained from https://github.com/cran/cstab with some minor modifications |
|
3 |
+# function was obtained from https://github.com/cran/cstab with some |
|
4 |
+# minor modifications |
|
4 | 5 |
|
5 | 6 |
.cDistance <- function(data, # n x p data matrix |
6 | 7 |
kSeq, # sequence of ks to be checked |
7 | 8 |
linkage = "average", |
8 |
- gapIter = 10) # number of simulated datasets in gap statistic |
|
9 |
+ gapIter = 10) # n of simulated datasets in gap statistic |
|
9 | 10 |
{ |
10 | 11 |
|
11 | 12 |
# ----- INPUT TESTS |
... | ... |
@@ -14,7 +15,9 @@ |
14 | 15 |
if (sum(is.na(data)) > 0) stop("No missing values permitted!") |
15 | 16 |
|
16 | 17 |
# On k-sequence |
17 |
- if (1 %in% kSeq) stop("Please select a k sequence starting with 2: {2,3,...K}!") |
|
18 |
+ if (1 %in% kSeq) { |
|
19 |
+ stop("Please select a k sequence starting with 2: {2,3,...K}!") |
|
20 |
+ } |
|
18 | 21 |
|
19 | 22 |
|
20 | 23 |
# ----- HELPERS |