diff --git a/NAMESPACE b/NAMESPACE index dc7a8ce8..47ea46b6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -118,8 +118,10 @@ S3method(rxUiGet,popedCovd) S3method(rxUiGet,popedD) S3method(rxUiGet,popedFErrorFun) S3method(rxUiGet,popedFfFun) +S3method(rxUiGet,popedFfFunScript) S3method(rxUiGet,popedFgFun) S3method(rxUiGet,popedFullRxModel) +S3method(rxUiGet,popedGetEventFun) S3method(rxUiGet,popedNotfixedBpop) S3method(rxUiGet,popedNotfixedCovd) S3method(rxUiGet,popedNotfixedD) diff --git a/R/poped.R b/R/poped.R index 2221d281..2972532a 100644 --- a/R/poped.R +++ b/R/poped.R @@ -1840,6 +1840,15 @@ attr(rxUiGet.popedParameters, "desc") <- "PopED input $parameters" #' the model #' @param script write a PopED/rxode2 script that can be modified for #' more fine control. The default is NULL. +#' +#' When `script` is TRUE, the script is returned as a lines that +#' would be written to a file and with the class +#' `babelmixr2popedScript`. This allows it to be printed as the +#' script on screen. +#' +#' When `script` is a file name (with an R extension), the script is +#' written to that file. +#' #' @inheritParams nlmixr2est::foceiControl #' @inheritParams PopED::create.poped.database #' @inheritParams PopED::create_design_space @@ -2159,6 +2168,14 @@ popedControl <- function(stickyRecalcN=4, checkmate::assertLogical(bParallelSG, any.missing=FALSE, len=1) checkmate::assertLogical(bParallelMFEA, any.missing=FALSE, len=1) checkmate::assertLogical(bParallelLS, any.missing=FALSE, len=1) + if (is.null(script)) { + } else if (checkmate::testLogical(script, len=1, any.missing=FALSE)) { + if (!script) { + script <- NULL + } + } else { + checkmate::assertPathForOutput(script, extension=".R") + } .ret <- list(rxControl=rxControl, stickyRecalcN=as.integer(stickyRecalcN), diff --git a/man/popedControl.Rd b/man/popedControl.Rd index cb8f0eaf..b27fb483 100644 --- a/man/popedControl.Rd +++ b/man/popedControl.Rd @@ -132,6 +132,7 @@ popedControl( auto_pointer = "", user_distribution_pointer = "", fixRes = FALSE, + script = NULL, ... ) } @@ -520,7 +521,19 @@ Autocorrelation function, empty string means no autocorrelation.} \item{user_distribution_pointer}{Filename and path, or function name, for user defined distributions for E-family designs} -\item{fixRes}{boolean; Fix the residuals to what is specified by the model} +\item{fixRes}{boolean; Fix the residuals to what is specified by +the model} + +\item{script}{write a PopED/rxode2 script that can be modified for +more fine control. The default is NULL. + +When \code{script} is TRUE, the script is returned as a lines that +would be written to a file and with the class +\code{babelmixr2popedScript}. This allows it to be printed as the +script on screen. + +When \code{script} is a file name (with an R extension), the script is +written to that file.} \item{...}{other parameters for PopED control} }