diff --git a/Project.toml b/Project.toml index eb4adf2..70ca78a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MortalityTables" uuid = "4780e19d-04b9-53dc-86c2-9e9aa59b5a12" authors = ["Alec Loudenback "] -version = "2.1.0" +version = "2.1.1" [deps] OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" diff --git a/src/life_expectancy.jl b/src/life_expectancy.jl index c9e2c7d..8d1d329 100644 --- a/src/life_expectancy.jl +++ b/src/life_expectancy.jl @@ -5,7 +5,7 @@ Calcuate the remaining life expectancy. Assumes curtate life expectancy for tables if not Parametric or DeathDistribution given. """ function life_expectancy(table,age) - sum(survival(table,age,age + dur) for dur in 1:length(table) -age) + sum(survival(table,age,age + dur) for dur in 1:lastindex(table) -age) end function life_expectancy(table,age,dist)