Browse code

add return value to docs

Nick authored on 05/10/2022 23:11:34
Showing 3 changed files

... ...
@@ -6,6 +6,8 @@
6 6
 #' @param distMat A distance matrix
7 7
 #' @param minClusterSize The minimum cluster size
8 8
 #' @param alpha a value between 0 and 1 specifying the desired level of cutoff
9
+#' @return Optimal number of clusters 
10
+#'
9 11
 #' @importFrom stats kmeans
10 12
 .runDiscriminant <- function(distMat, minClusterSize, alpha = 0.001) {
11 13
 
... ...
@@ -8,6 +8,9 @@
8 8
 #'                      instead of the prcomp for computing the principal
9 9
 #'                      components when no weights are given (see details)
10 10
 #' @param ... not used
11
+#' @return A list containing: `prototype`, a matrix containing appropriate
12
+#'         initial prototypes, and `data.pca` the results of the PCA conducted
13
+#'         on the data
11 14
 #'
12 15
 #' @importFrom stats princomp prcomp cov.wt
13 16
 somInitPca.default <- function(data, somGrid, weights, with.princomp = FALSE, ...) {
... ...
@@ -2,6 +2,8 @@
2 2
 #' Function to do percentile normalizaton
3 3
 #'
4 4
 #' @param x Matrix to percentile normilse.
5
+#' @return percentile normalized version of `x`
6
+#'
5 7
 #' @importFrom stats quantile
6 8
 .percentileNorm <- function(x) {
7 9
   x <- as.matrix(x)
... ...
@@ -15,8 +17,10 @@
15 17
 
16 18
 #' Function to do min max normalization
17 19
 #'
18
-#' @param x Matrix to min max nomalize.
19 20
 #' @importFrom stats quantile
21
+#'
22
+#' @param x Matrix to min max nomalize.
23
+#' @return Max normalized version of `x`
20 24
 .minmaxNorm <- function(x) {
21 25
   x <- as.matrix(x)
22 26
   percentiles <- quantile(x, probs = c(0.01, 0.99))
... ...
@@ -30,6 +34,7 @@
30 34
 #'
31 35
 #' @param x A numeric or complex vector
32 36
 #' @param cofactor Cofactor of the vector. Default is 5.
37
+#' @return Arsinh normalized vector.
33 38
 .arsinhNnorm <- function(x, cofactor = 5) {
34 39
   x <- asinh(x / cofactor)
35 40
   return(x)
... ...
@@ -39,6 +44,7 @@
39 44
 #' this function was obtained from the Stab package
40 45
 #'
41 46
 #' @param data A data matrix.
47
+#' @return Uniform random noise with `dim(data)`
42 48
 .uniformData <- function(data) {
43 49
 
44 50
   # get dimensions of data
... ...
@@ -56,6 +62,7 @@
56 62
 #' A function to compute the elbow point given a set of points
57 63
 #'
58 64
 #' @param vals Values to compute the elbow point of.
65
+#' @return A integer indicating the elbow point of `vals`.
59 66
 .computeElbow <- function(vals) {
60 67
   diffs <- diff(vals)
61 68
   diffs <- diffs[-1]