Skip to content

Commit

Permalink
Replaced 1:npops with seq_len(npops) (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Aug 9, 2023
1 parent 5d3acc7 commit f93f7c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/indMix.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ indMix <- function(c, npops, counts = NULL, sumcounts = NULL, max_iter = 100L, d
}
} else if (round == 2) { # Populaation yhdist�minen toiseen.
maxMuutos <- 0
for (pop in 1:npops) {
for (pop in seq_len(npops)) {
muutokset_diffInCounts <- greedyMix_muutokset$new()
muutokset_diffInCounts <- muutokset_diffInCounts$laskeMuutokset2(
pop, rows, data, adjprior, priorTerm
Expand Down Expand Up @@ -245,7 +245,7 @@ indMix <- function(c, npops, counts = NULL, sumcounts = NULL, max_iter = 100L, d
} else if (round == 3 || round == 4) { # Populaation jakaminen osiin.
maxMuutos <- 0
ninds <- size(rows, 1)
for (pop in 1:npops) {
for (pop in seq_len(npops)) {
inds2 <- matlab2r::find(PARTITION == pop)
ninds2 <- length(inds2)
if (ninds2 > 2) {
Expand Down Expand Up @@ -547,7 +547,7 @@ indMix <- function(c, npops, counts = NULL, sumcounts = NULL, max_iter = 100L, d
# TALLENNETAAN

npops <- poistaTyhjatPopulaatiot(npops)
POP_LOGML <- computePopulationLogml(1:npops, adjprior, priorTerm)
POP_LOGML <- computePopulationLogml(seq_len(npops), adjprior, priorTerm)
if (dispText) {
message("Found partition with ", as.character(npops), " populations.")
message("Log(ml) = ", as.character(logml))
Expand Down

0 comments on commit f93f7c7

Please sign in to comment.