From c502fd45dce16f5d89e68c9dfe21dc83d520117b Mon Sep 17 00:00:00 2001 From: Jennifer Thom Date: Fri, 30 Aug 2024 11:27:13 +0100 Subject: [PATCH] use `distinct(chi)` --- R/process_lookup_deaths.R | 1 + R/process_refined_death.R | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/R/process_lookup_deaths.R b/R/process_lookup_deaths.R index edc083cd2..02a451cb4 100644 --- a/R/process_lookup_deaths.R +++ b/R/process_lookup_deaths.R @@ -23,6 +23,7 @@ process_slf_deaths_lookup <- function( dplyr::mutate( deceased = TRUE ) %>% + dplyr::distinct(chi, .keep_all = TRUE) %>% # save anon chi on disk slfhelper::get_anon_chi() diff --git a/R/process_refined_death.R b/R/process_refined_death.R index 58ed1b29d..be676032d 100644 --- a/R/process_refined_death.R +++ b/R/process_refined_death.R @@ -49,7 +49,8 @@ process_refined_death <- function( dplyr::mutate( fy = phsmethods::extract_fin_year(death_date), fy = as.character(paste0(substr(fy, 3, 4), substr(fy, 6, 7))) - ) + ) %>% + dplyr::distinct(anon_chi, .keep_all = TRUE) if (write_to_disk) { write_file(