From c5e6016ce010664cf1984f5aab3a5d8fc1baee33 Mon Sep 17 00:00:00 2001 From: Zihao Li Date: Tue, 8 Aug 2023 10:34:20 +0100 Subject: [PATCH] Update R/aggregate_by_chi.R Co-authored-by: James McMahon --- R/aggregate_by_chi.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/aggregate_by_chi.R b/R/aggregate_by_chi.R index b91ce1642..5e7ebc7c0 100644 --- a/R/aggregate_by_chi.R +++ b/R/aggregate_by_chi.R @@ -127,8 +127,8 @@ aggregate_by_chi <- function(episode_file) { .( preventable_beddays = ifelse( any(cij_ppa, na.rm = TRUE), - min(cij_end_date, end_fy(year)) - max(cij_start_date, start_fy(year)), - NA_real_ + as.integer(min(cij_end_date, end_fy(year)) - max(cij_start_date, start_fy(year))), + NA_integer_ ) ), # cij_marker has been renamed as cij_total