From 6399eb6de7cb233e64ea2aee0d8108c9fdea3644 Mon Sep 17 00:00:00 2001 From: Hana Sevcikova Date: Thu, 12 Dec 2024 14:06:37 -0800 Subject: [PATCH] bug fix --- DESCRIPTION | 4 ++-- R/predict.pop.R | 4 ++-- R/predict_subnat.R | 4 ++-- README.md | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1a51cde..77ac3ff 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: bayesPop Type: Package Title: Probabilistic Population Projection -Version: 10.0-1.9023 -Date: 2024-12-10 +Version: 10.0-1.9024 +Date: 2024-12-12 Author: Hana Sevcikova, Adrian Raftery, Thomas Buettner Maintainer: Hana Sevcikova Depends: R (>= 3.5.0), bayesTFR (>= 7.1-0), bayesLife (>= 5.0-0), MortCast (>= 2.6-1) diff --git a/R/predict.pop.R b/R/predict.pop.R index 1dfdadd..1cb726c 100644 --- a/R/predict.pop.R +++ b/R/predict.pop.R @@ -637,7 +637,7 @@ load.inputs <- function(inputs, start.year, present.year, end.year, wpp.year, fi if(!is.null((rates <- attr(miginp[["migM"]], "rate")))){ if(length(intersect(proj.periods, colnames(rates))) > 0) { attr(MIGm, "rate") <- rates[, c('country_code', intersect(proj.periods, colnames(rates))), with = FALSE] - attr(MIGm, "code") <- attr(miginp[["migM"]], "code")[, c('country_code', intersect(proj.periods, colnames(code))), with = FALSE] + attr(MIGm, "code") <- attr(miginp[["migM"]], "code")[, c('country_code', intersect(proj.periods, colnames(attr(miginp[["migM"]], "code")))), with = FALSE] } else { attr(MIGm, "rate") <- NULL attr(MIGm, "code") <- NULL @@ -650,7 +650,7 @@ load.inputs <- function(inputs, start.year, present.year, end.year, wpp.year, fi if(!is.null((rates <- attr(miginp[["migF"]], "rate")))){ if(length(intersect(proj.periods, colnames(rates))) > 0) { attr(MIGf, "rate") <- rates[, c('country_code', intersect(proj.periods, colnames(rates))), with = FALSE] - attr(MIGf, "code") <- attr(miginp[["migF"]], "code")[, c('country_code', intersect(proj.periods, colnames(code))), with = FALSE] + attr(MIGf, "code") <- attr(miginp[["migF"]], "code")[, c('country_code', intersect(proj.periods, colnames(attr(miginp[["migF"]], "code")))), with = FALSE] } else { attr(MIGf, "rate") <- NULL attr(MIGf, "code") <- NULL diff --git a/R/predict_subnat.R b/R/predict_subnat.R index b04e6bf..a725d11 100644 --- a/R/predict_subnat.R +++ b/R/predict_subnat.R @@ -334,7 +334,7 @@ load.subnat.inputs <- function(inputs, start.year, present.year, end.year, wpp.y if(!is.null((rates <- attr(miginp[["migM"]], "rate")))){ if(length(intersect(proj.periods, colnames(rates))) > 0) { attr(MIGm, "rate") <- rates[, c('country_code', intersect(proj.periods, colnames(rates))), with = FALSE] - attr(MIGm, "code") <- attr(miginp[["migM"]], "code")[, c('country_code', intersect(proj.periods, colnames(code))), with = FALSE] + attr(MIGm, "code") <- attr(miginp[["migM"]], "code")[, c('country_code', intersect(proj.periods, colnames(attr(miginp[["migM"]], "code")))), with = FALSE] } else { attr(MIGm, "rate") <- NULL attr(MIGm, "code") <- NULL @@ -347,7 +347,7 @@ load.subnat.inputs <- function(inputs, start.year, present.year, end.year, wpp.y if(!is.null((rates <- attr(miginp[["migF"]], "rate")))){ if(length(intersect(proj.periods, colnames(rates))) > 0) { attr(MIGf, "rate") <- rates[, c('country_code', intersect(proj.periods, colnames(rates))), with = FALSE] - attr(MIGf, "code") <- attr(miginp[["migF"]], "code")[, c('country_code', intersect(proj.periods, colnames(code))), with = FALSE] + attr(MIGf, "code") <- attr(miginp[["migF"]], "code")[, c('country_code', intersect(proj.periods, attr(miginp[["migF"]], "code"))), with = FALSE] } else { attr(MIGf, "rate") <- NULL attr(MIGf, "code") <- NULL diff --git a/README.md b/README.md index 397693b..59873b4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![R build status](https://github.com/PPgp/bayesPop/workflows/R-CMD-check/badge.svg?branch=master)](https://github.com/PPgp/bayesPop/actions?workflow=R-CMD-check) -R package for obtaining probabilisitc population projections. [This paper](http://www.unece.org/fileadmin/DAM/stats/documents/ece/ces/ge.11/2013/WP_13.2.pdf) +R package for obtaining probabilistic population projections. [This paper](http://www.unece.org/fileadmin/DAM/stats/documents/ece/ces/ge.11/2013/WP_13.2.pdf) shows how to use it. If for any reason the package is not on CRAN or you would like the latest development version, install it from here as follows: