Skip to content

Commit

Permalink
review2_part1
Browse files Browse the repository at this point in the history
- add reviewer in DESCRIPTION
- add assertions about numInit and maxIter in pkbc function are single numeric values
  • Loading branch information
giovsaraceno committed Jan 29, 2025
1 parent 71b851f commit d3a3823
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Authors@R: c(
person("Marianthi", "Markatou", role = "aut"),
person("Raktim", "Mukhopadhyay", role = "aut"),
person("Mojgan", "Golzy", role = c("aut")),
person("Hingee", "Kassel", role = "rev")
person("Hingee", "Kassel", role = "rev"),
person("Emi", "Tanaka", role = "rev")
)
Maintainer: Giovanni Saraceno <[email protected]>
Description: It includes test for multivariate normality, test for uniformity on the d-dimensional
Expand Down
16 changes: 12 additions & 4 deletions R/clustering_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ setMethod("pkbc", signature(dat = "ANY"),
stop("nClust must be a single value or a numeric vector of possible
values")
}
if (maxIter < 1) {
stop("Input parameter maxIter must be greater than 0")
if(is.vector(maxIter) & is.integer(maxIter)) {
if (maxIter < 0) {
stop("Input parameter maxIter must be an integer greater than 0.")
}
} else {
stop("maxIter must be a single integer value.")
}
if ( !(stoppingRule %in% c("max", "membership", "loglik")) ) {
stop(paste("Unrecognized value ", stoppingRule, " in input
Expand All @@ -186,8 +190,12 @@ setMethod("pkbc", signature(dat = "ANY"),
stop(paste("Unrecognized value ", initMethod, " in input
parameter initMethod.", sep=''))
}
if (numInit < 1) {
stop("Input parameter numInit must be greater than 0")
if(is.vector(numInit) & is.integer(numInit)) {
if (numInit < 0) {
stop("Input parameter numInit must be greater than 0.")
}
} else {
stop("numInit must be a single integer value.")
}

# set options for stopping rule
Expand Down

0 comments on commit d3a3823

Please sign in to comment.