Skip to content

Commit

Permalink
fixing verbose - functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ytarazona committed Apr 18, 2021
1 parent d38a70c commit 9fc71cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/calkmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ calkmeans <- function(img, k = NULL, iter.max = 10, algo = c("Hartigan-Wong", "L
vr <- getValues(img)

if (verbose) {
message(paste0(paste0(rep("*", 10), collapse = ""), " Selecting k for which the intra-class inertia is stabilized ", collapse = ""))
message(paste0(paste0(rep("*", 10), collapse = ""), " Selecting k for which the intra-class inertia is stabilized ", paste0(rep("*", 10), collapse = ""), collapse = ""))
}

# Hartigan-Wong
Expand Down Expand Up @@ -147,8 +147,9 @@ calkmeans <- function(img, k = NULL, iter.max = 10, algo = c("Hartigan-Wong", "L
return(structure(resulFinal, class = "calkmeans"))

} else if (inherits(k, "numeric")) {

if (verbose) {
# message(paste0(paste0(rep("*", 10), collapse = ""), " Selecting the best algorithm embedded in kmeans, that maximizes inter-class distances ", TypeEndm, paste0(rep("*", 10), collapse = ""))) #JN: there is something wrong here... TypeEndm is not declared before
message(paste0(paste0(rep("*", 10), collapse = ""), " Selecting the best algorithm embedded in kmeans, that maximizes inter-class distances ", paste0(rep("*", 10), collapse = ""), collapse = ""))
}

algo_test <- c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen")
Expand Down
1 change: 0 additions & 1 deletion R/fusionRS.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ fusionRS <- function(x, y, stand.varb = TRUE, na.rm = FALSE, verbose = FALSE) {

if (verbose) {
message(paste0(paste0(rep("*", 10), collapse = ""), " Verifying the same extent ", paste0(rep("*", 10), collapse = "")))
# print(model_algo) #JN: there is something wrong here... model_algo is not declared before
}

if (inherits(x, "RasterStack") | inherits(x, "RasterBrick") & inherits(y, "RasterStack") | inherits(y, "RasterBrick")) {
Expand Down

0 comments on commit 9fc71cd

Please sign in to comment.