The culprit is seq(0, length(pop[ , i]), by = round(length(pop[ , i]) / 10))[-1]) .
This code occurs in several pathways in simulation_results-class.R, e.g. line 199, for both single or multiple replicates.
Error produced is
Error in seq.default(0, length(pop.mn[, i]), by = round(length(pop.mn[, : invalid '(to - from)/by'
(or pop[,i] if single replicate.)
This is because rounding x/10 to 0 decimal places, where x <= 5, produces 0, and seq(from = y, to = z, by = 0) tries to divide by 0 and produces the error.
Suggested fix may be to check if length(pop[,i]) or length(pop.mn[,i]) is <= 5 and if it is replacing the to argument in seq with something reasonable, e.g. 1)
The culprit is
seq(0, length(pop[ , i]), by = round(length(pop[ , i]) / 10))[-1])
.This code occurs in several pathways in simulation_results-class.R, e.g. line 199, for both single or multiple replicates.
Error produced is
(or
pop[,i]
if single replicate.)This is because rounding x/10 to 0 decimal places, where x <= 5, produces 0, and
seq(from = y, to = z, by = 0)
tries to divide by 0 and produces the error.Suggested fix may be to check if
length(pop[,i])
orlength(pop.mn[,i])
is <= 5 and if it is replacing theto
argument inseq
with something reasonable, e.g. 1)