From dcdc7374dd179b4dca54c0061007c94c96af7387 Mon Sep 17 00:00:00 2001 From: mathesong Date: Wed, 28 Aug 2024 17:34:41 +0200 Subject: [PATCH] Fixed bloodstream import to convert AIFpars to numeric --- R/kinfitr_bloodstream.R | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/R/kinfitr_bloodstream.R b/R/kinfitr_bloodstream.R index 1508b31..ea3493c 100644 --- a/R/kinfitr_bloodstream.R +++ b/R/kinfitr_bloodstream.R @@ -176,17 +176,21 @@ bloodstream_parameter_fix <- function(AIFmodel, AIFpars, Unit_time, Unit_AIF) { feng <- AIFmodel == "Fit Individually: Feng" fengconv <- AIFmodel == "Fit Individually: FengConv" + parnames <- colnames(AIFpars) + + AIFpars <- AIFpars %>% + dplyr::mutate(dplyr::across(dplyr::all_of(parnames), as.numeric)) ###### Tri-exponential ###### if(triexp) { if(Unit_time == "s") { - AIFpars$alpha <- AIFpars$alpha*60 - AIFpars$beta <- AIFpars$beta *60 - AIFpars$gamma <- AIFpars$gamma*60 + AIFpars$alpha <- as.numeric(AIFpars$alpha*60) + AIFpars$beta <- as.numeric(AIFpars$beta *60) + AIFpars$gamma <- as.numeric(AIFpars$gamma*60) - AIFpars$t0 <- AIFpars$t0/60 - AIFpars$peaktime <- AIFpars$peaktime/60 + AIFpars$t0 <- as.numeric(AIFpars$t0/60) + AIFpars$peaktime <- as.numeric(AIFpars$peaktime/60) } if(Unit_AIF != "kBq") {