15 lines
444 B
R
15 lines
444 B
R
|
|
poistaTyhjatPopulaatiot <- function(npops) {
|
|||
|
|
# % Poistaa tyhjentyneet populaatiot COUNTS:ista ja
|
|||
|
|
# % SUMCOUNTS:ista. P<>ivitt<74><74> npops:in ja PARTITION:in.
|
|||
|
|
notEmpty <- find(any(SUMCOUNTS, 2))
|
|||
|
|
COUNTS <<- COUNTS[, , notEmpty]
|
|||
|
|
SUMCOUNTS <<- SUMCOUNTS[notEmpty, ]
|
|||
|
|
LOGDIFF <<- LOGDIFF[, notEmpty]
|
|||
|
|
|
|||
|
|
for (n in 1:length(notEmpty)) {
|
|||
|
|
apu <- find(PARTITION == notEmpty(n))
|
|||
|
|
PARTITION(apu) <<- n
|
|||
|
|
}
|
|||
|
|
npops <- length(notEmpty)
|
|||
|
|
return(npops)
|
|||
|
|
}
|