From 1693710a14c19bad04d2aaea80638713d7826495 Mon Sep 17 00:00:00 2001 From: Jordan Brooks Date: Thu, 6 Jun 2024 19:35:18 +0000 Subject: [PATCH] altered logic when t_inf==0 to update to 1/60 for infusion, sc, and im --- R/new_regimen.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/R/new_regimen.R b/R/new_regimen.R index 729fce3..134f9e6 100644 --- a/R/new_regimen.R +++ b/R/new_regimen.R @@ -143,10 +143,8 @@ new_regimen <- function( } if(any(reg$type == "infusion" | reg$type == "sc" | reg$type == "im")) { if(any(reg$t_inf == 0)) { - reg$t_inf[reg$t_inf == 0 & (type =="sc" | type =="im")] <- 1/60 - reg$rate[reg$t_inf == 0 & (type =="sc" | type =="im")] <- 60 - reg$t_inf[reg$t_inf == 0 & type == "infusion"] <- 1/60 - reg$rate[reg$t_inf == 0 & type == "infusion"] <- 60 + reg$t_inf[reg$t_inf == 0] <- 1/60 + reg$rate[reg$t_inf == 0] <- 60 } } if(any(reg$type == "bolus")) {