From 6c3e2aff04b5e1a6123e73c7e63cc96ef9176a64 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Mon, 8 Apr 2024 10:11:25 +0200 Subject: [PATCH] Fixed calculation og `ninds` (#24) --- R/greedyMix.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/greedyMix.R b/R/greedyMix.R index 625544c..bab5649 100644 --- a/R/greedyMix.R +++ b/R/greedyMix.R @@ -53,6 +53,7 @@ greedyMix <- function( } # Comparing partitions ======================================================= + ninds <- length(unique(c[["data"]][, ncol(c[["data"]])])) if (!is.null(partitionCompare)) { logmls <- comparePartitions( c[["data"]], nrow(c[["data"]]), partitionCompare[["partitions"]], ninds, @@ -61,7 +62,6 @@ greedyMix <- function( } # Generating partition summary =============================================== - ninds <- length(unique(data$data[, ncol(data$data)])) ekat <- seq(1L, ninds * c[["rowsFromInd"]], c[["rowsFromInd"]]) c[["rows"]] <- cbind(ekat, ekat + c[["rowsFromInd"]] - 1L) logml_npops_partitionSummary <- indMixWrapper(c, npops, counts, sumcounts, max_iter, fixedK, verbose)