2020-11-09 08:35:41 +01:00
|
|
|
|
poistaTyhjatPopulaatiot <- function(npops) {
|
2024-07-02 12:17:02 +02:00
|
|
|
|
# % Poistaa tyhjentyneet populaatiot globals$COUNTS:ista ja
|
|
|
|
|
|
# % globals$SUMCOUNTS:ista. P<>ivitt<74><74> npops:in ja globals$PARTITION:in.
|
|
|
|
|
|
notEmpty <- matlab2r::find(apply(globals$SUMCOUNTS, 1, function(x) any(x > 0)))
|
|
|
|
|
|
globals$COUNTS <- globals$COUNTS[, , notEmpty]
|
|
|
|
|
|
globals$SUMCOUNTS <- globals$SUMCOUNTS[notEmpty, ]
|
|
|
|
|
|
globals$LOGDIFF <- globals$LOGDIFF[, notEmpty]
|
2020-11-09 08:35:41 +01:00
|
|
|
|
|
2021-11-10 14:02:35 +01:00
|
|
|
|
for (n in 1:length(notEmpty)) {
|
2024-07-02 12:17:02 +02:00
|
|
|
|
apu <- matlab2r::find(globals$PARTITION == notEmpty[n])
|
|
|
|
|
|
globals$PARTITION[apu] <- n
|
2021-11-10 14:02:35 +01:00
|
|
|
|
}
|
|
|
|
|
|
npops <- length(notEmpty)
|
|
|
|
|
|
return(npops)
|
|
|
|
|
|
}
|