diff --git a/DESCRIPTION b/DESCRIPTION index 3b924f9b6..724bbdcc9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: datapackr Type: Package Title: A Package that Packs and Unpacks all Data Packs -Version: 5.5.0 -Date: 2022-12-07 +Version: 5.5.1 +Date: 2022-12-16 Authors@R: c( person("Scott", "Jackson", email = "sjackson@baosystems.com", role = c("aut", "cre")), diff --git a/NEWS.md b/NEWS.md index 873d17560..cc0e2c0d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# datapackr 5.5.1 + +## Breaking changes + +## New features + +## Minor improvements and fixes +* Added TX_PVLS(D) to memo + + # datapackr 5.5.0 ## Breaking changes diff --git a/R/generateApprovalMemo.R b/R/generateApprovalMemo.R index 0901a9fba..23b7f9a0b 100644 --- a/R/generateApprovalMemo.R +++ b/R/generateApprovalMemo.R @@ -265,9 +265,7 @@ renderPartnerTable <- function(memo_doc, partners_table, memoStructure, source_t dplyr::mutate_if(is.numeric, zerosToDashes) sub_heading <- names(partners_table)[4:length(partners_table)] %>% - stringr::str_split(., " ") %>% - purrr::map(purrr::pluck(2)) %>% - unlist() %>% + stringr::str_extract(., "<15|15\\+|<18|18\\+|Total") %>% c("Funding Agency", "Partner", "Mechanism", .) group_heading <- names(partners_table)[4:length(partners_table)] %>% diff --git a/R/memoStructure.R b/R/memoStructure.R index e09900d16..a7df8a495 100644 --- a/R/memoStructure.R +++ b/R/memoStructure.R @@ -32,9 +32,9 @@ memoStructure <- function(d, d2_session = dynGet("d2_default_session", "TX_CURR", "<15", 1, "TX_CURR", "15+", 1, "TX_CURR", "Total", NA, - "TX_PVLS", "<15", 1, - "TX_PVLS", "15+", 1, - "TX_PVLS", "Total", NA, + "TX_PVLS_(N)", "<15", 1, + "TX_PVLS_(N)", "15+", 1, + "TX_PVLS_(N)", "Total", NA, "CXCA_SCRN", "Total", 2, "OVC_SERV", "<18", 2, "OVC_SERV", "18+", 2, @@ -86,11 +86,14 @@ memoStructure <- function(d, d2_session = dynGet("d2_default_session", "TX_CURR", "<15", 1, "TX_CURR", "15+", 1, "TX_CURR", "Total", NA, - "TX_PVLS", "<15", 1, - "TX_PVLS", "15+", 1, - "TX_PVLS", "Total", NA, - "HTS_SELF", "<15", 1, - "HTS_SELF", "15+", 1, + "TX_PVLS_(D)", "<15", 1, + "TX_PVLS_(D)", "15+", 1, + "TX_PVLS_(D)", "Total", NA, + "TX_PVLS_(N)", "<15", 1, + "TX_PVLS_(N)", "15+", 1, + "TX_PVLS_(N)", "Total", NA, + "HTS_SELF", "<15", 2, + "HTS_SELF", "15+", 2, "HTS_SELF", "Total", NA, "HTS_TST", "<15", 2, "HTS_TST", "15+", 2, diff --git a/R/prepareMemoData.R b/R/prepareMemoData.R index 6addba03b..8ba8f48a1 100644 --- a/R/prepareMemoData.R +++ b/R/prepareMemoData.R @@ -188,6 +188,8 @@ prepareMemoDataByPSNU <- function(analytics, "GEND_GBV Physical and Emotional Violence", Indicator == "GEND_GBV" & N_OR_D == "Sexual" ~ "GEND_GBV Sexual Violence", + Indicator == "TX_PVLS" & N_OR_D == "(D)" ~ "TX_PVLS_(D)", + Indicator == "TX_PVLS" & N_OR_D == "(N)" ~ "TX_PVLS_(N)", TRUE ~ Indicator)) %>% dplyr::select(-"N_OR_D") %>% dplyr::mutate(Age = dplyr::case_when(Age == "15-" ~ "<15",