From a4757127b35cb0ea5f9d25b0c7847b78e2794f90 Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Wed, 18 Sep 2024 10:26:25 -0500 Subject: [PATCH] check for file existence --- R/monolix2rx.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/R/monolix2rx.R b/R/monolix2rx.R index 1f62def..65cd74f 100644 --- a/R/monolix2rx.R +++ b/R/monolix2rx.R @@ -88,6 +88,12 @@ monolix2rx <- function(mlxtran, update=TRUE, thetaMatType=c("sa", "lin"), } .admd <- NULL .cmt <- NULL + if (!is.null(.mlxtran$MODEL$LONGITUDINAL$LONGITUDINAL$file)) { + if (!file.exists(.mlxtran$MODEL$LONGITUDINAL$LONGITUDINAL$file)) { + stop("the model file '", .mlxtran$MODEL$LONGITUDINAL$LONGITUDINAL$file, "' does not exist\nyou may need to setup the model library to complete translation", + call.=FALSE) + } + } if (is.null(.mlxtran$MODEL$LONGITUDINAL$EQUATION) && !is.null(.mlxtran$MODEL$LONGITUDINAL$PK)) { .e <- .equation("", .mlxtran$MODEL$LONGITUDINAL$PK)