# NOT RUN {
data(e0Fproj, package = "wpp2017")
country <- "Uganda"
# get target e0
e0f <- subset(e0Fproj, name == country)[-(1:2)]
# project into future using life table Cole-Demeny North
mx <- mlt(e0f, sex = "female", type = "CD_North")
# plot first projection in black and the remaining ones in grey
plot(mx[,1], type = "l", log = "y", ylim = range(mx),
ylab = "female mx", xlab = "Age",
main = paste(country, "5-year age groups"))
for(i in 2:ncol(mx)) lines(mx[,i], col = "grey")
# MLT for 1-year age groups
mx1y <- mlt(e0f, sex = "female", type = "CD_North", nx = 1)
plot(mx1y[,1], type = "l", log = "y", ylim = range(mx1y),
ylab = "female mx", xlab = "Age",
main = paste(country, "1-year age groups"))
for(i in 2:ncol(mx1y)) lines(mx1y[,i], col = "grey")
# }
Run the code above in your browser using DataLab