diff --git a/R/indMix.R b/R/indMix.R index d161d46..6d67cec 100644 --- a/R/indMix.R +++ b/R/indMix.R @@ -129,7 +129,7 @@ indMix <- function(c, npops, counts = NULL, sumcounts = NULL, max_iter = 100L, d while (ready != 1) { iter <- iter + 1L if (iter > max_iter) { - warning("max_iter reached. Stopping.") + warning("max_iter reached. Stopping prematurely.") break } # FIXME: loop caught in here diff --git a/R/poistaTyhjatPopulaatiot.R b/R/poistaTyhjatPopulaatiot.R index 4f51928..0635e9a 100644 --- a/R/poistaTyhjatPopulaatiot.R +++ b/R/poistaTyhjatPopulaatiot.R @@ -1,7 +1,7 @@ poistaTyhjatPopulaatiot <- function(npops) { # % Poistaa tyhjentyneet populaatiot COUNTS:ista ja # % SUMCOUNTS:ista. P�ivitt�� npops:in ja PARTITION:in. - notEmpty <- matlab2r::find(any(SUMCOUNTS, 2)) + notEmpty <- matlab2r::find(apply(SUMCOUNTS, 1, function(x) any(x > 0))) COUNTS <- COUNTS[, , notEmpty] SUMCOUNTS <- SUMCOUNTS[notEmpty, ] LOGDIFF <- LOGDIFF[, notEmpty]