diff --git a/R/piping-model.R b/R/piping-model.R index 20066d00c..e801a9f34 100644 --- a/R/piping-model.R +++ b/R/piping-model.R @@ -117,18 +117,27 @@ model.rxModelVars <- model.rxode2 } if (.doAppend) { # in pre-pending or appending, lines are only added - .lhs <- character() - .rhs <- character() + .lhs <- character(0) + .rhs <- character(0) + .lhs0 <- c(rxui$mv0$lhs, rxui$mv0$state, rxui$allCovs, rxui$iniDf$name) for (x in modelLines) { .isTilde <- .isEndpoint(x) if (.isTilde || .isAssignment(x)) { .rhs <- unique(c(.getVariablesFromExpression(.getRhs(x), ignorePipe=.isTilde), .rhs)) .lhs <- unique(c(.getVariablesFromExpression(.getLhs(x)), .lhs)) } - .rhs <- setdiff(.rhs, c(.lhs, rxui$mv0$lhs, rxui$mv0$state, rxui$allCovs, rxui$iniDf$name)) + .rhs <- setdiff(.rhs, c(.lhs, .lhs0)) if (isTRUE(auto)) { for (v in .rhs) { - .addVariableToIniDf(v, rxui, promote=ifelse(.isTilde,NA, TRUE)) + .isCov <- grepl(.varSelect$covariateExceptions, tolower(v)) + .isTheta <- !.isCov && grepl(.varSelect$thetaModelReg, v) + .isEta <- !.isCov && grepl(.varSelect$etaModelReg, v) + if (.isTilde || .isTheta || .isEta) { + .addVariableToIniDf(v, rxui, + promote=ifelse(.isTilde,NA, + TRUE)) + .lhs <- c(.lhs, v) + } } } } @@ -693,7 +702,7 @@ attr(rxUiGet.errParams, "desc") <- "Get the error-associated variables" #' rxSetPipingAuto <- function(thetamodelVars=rex::rex(or("tv", "t", "pop", "POP", "Pop", "TV", "T", "cov", "err", "eff")), - covariateExceptions = rex::rex(start, or("wt", "sex", "crcl"), end), + covariateExceptions = rex::rex(start, or("wt", "sex", "crcl", "kout"), end), etaParts=c("eta", "ETA", "Eta", "ppv", "PPV", "Ppv", "iiv", "Iiv", "bsv", "Bsv", "BSV","bpv", "Bpv", "BPV", "psv", "PSV", "Psv") @@ -902,7 +911,6 @@ rxSetCovariateNamesForPiping <- function(covariates=NULL) { } } } - if (all(is.na(.iniDf$ntheta))) { .theta <- 1 } else { diff --git a/R/rxode2.R b/R/rxode2.R index d35b8ada4..ab880b93a 100644 --- a/R/rxode2.R +++ b/R/rxode2.R @@ -1244,13 +1244,13 @@ rxDllLoaded <- rxIsLoaded #' #' @return An rxDll object that has the following components #' -#' * `dll`{DLL path} -#' * `model`{model specification} -#' * `.c`{A function to call C code in the correct context from the DLL -#' using the [.C()] function.} -#' * `.call`{A function to call C code in the correct context from the DLL -#' using the [.Call()] function.} -#' * `args`{A list of the arguments used to create the rxDll object.} +#' * `dll` DLL path +#' * `model` model specification +#' * `.c` A function to call C code in the correct context from the DLL +#' using the [.C()] function. +#' * `.call` A function to call C code in the correct context from the DLL +#' using the [.Call()] function. +#' * `args` A list of the arguments used to create the rxDll object. #' @inheritParams rxode2 #' @seealso [rxode2()] #' @author Matthew L.Fidler @@ -1776,17 +1776,17 @@ rxModels_ <- # nolint #' #' @return A list of rxode2 model properties including: #' -#' * `params`{ a character vector of names of the model parameters} -#' * `lhs`{ a character vector of the names of the model calculated parameters} -#' * `state`{ a character vector of the compartments in rxode2 object} -#' * `trans`{ a named vector of translated model properties +#' * `params` a character vector of names of the model parameters +#' * `lhs` a character vector of the names of the model calculated parameters +#' * `state` a character vector of the compartments in rxode2 object +#' * `trans` a named vector of translated model properties #' including what type of jacobian is specified, the `C` function prefixes, -#' as well as the `C` functions names to be called through the compiled model.} -#' * `md5`{a named vector that gives the digest of the model (`file_md5`) and the parsed model -#' (`parsed_md5`)} -#' * `model`{ a named vector giving the input model (`model`), +#' as well as the `C` functions names to be called through the compiled model. +#' * `md5` a named vector that gives the digest of the model (`file_md5`) and the parsed model +#' (`parsed_md5`) +#' * `model` a named vector giving the input model (`model`), #' normalized model (no comments and standard syntax for parsing, `normModel`), -#' and interim code that is used to generate the final C file `parseModel`} +#' and interim code that is used to generate the final C file `parseModel` #' #' @keywords internal #' @family Query model information diff --git a/man/reexports.Rd b/man/reexports.Rd index 365c14ab7..f1310e9e9 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -82,4 +82,3 @@ below to see their documentation. \item{rxode2random}{\code{\link[rxode2random:dot-cbindOme]{.cbindOme}}, \code{\link[rxode2random:dot-expandPars]{.expandPars}}, \code{\link[rxode2random:dot-vecDf]{.vecDf}}, \code{\link[rxode2random]{cvPost}}, \code{\link[rxode2random]{invWR1d}}, \code{\link[rxode2random]{phi}}, \code{\link[rxode2random]{rinvchisq}}, \code{\link[rxode2random]{rLKJ1}}, \code{\link[rxode2random]{rxGetSeed}}, \code{\link[rxode2random]{rxGetSeed}}, \code{\link[rxode2random]{rxRmvn}}, \code{\link[rxode2random]{rxSeedEng}}, \code{\link[rxode2random]{rxSetSeed}}, \code{\link[rxode2random]{rxSetSeed}}, \code{\link[rxode2random]{rxSetSeed}}, \code{\link[rxode2random:rxWithSeed]{rxWithPreserveSeed}}, \code{\link[rxode2random]{rxWithSeed}}, \code{\link[rxode2random]{rxWithSeed}}} }} -\value{ Inherited from parent routine } diff --git a/man/rxCompile.Rd b/man/rxCompile.Rd index 25685936e..f9cf56615 100644 --- a/man/rxCompile.Rd +++ b/man/rxCompile.Rd @@ -92,13 +92,13 @@ function.} \value{ An rxDll object that has the following components \itemize{ -\item \code{dll}{DLL path} -\item \code{model}{model specification} -\item \code{.c}{A function to call C code in the correct context from the DLL -using the \code{\link[=.C]{.C()}} function.} -\item \code{.call}{A function to call C code in the correct context from the DLL -using the \code{\link[=.Call]{.Call()}} function.} -\item \code{args}{A list of the arguments used to create the rxDll object.} +\item \code{dll} DLL path +\item \code{model} model specification +\item \code{.c} A function to call C code in the correct context from the DLL +using the \code{\link[=.C]{.C()}} function. +\item \code{.call} A function to call C code in the correct context from the DLL +using the \code{\link[=.Call]{.Call()}} function. +\item \code{args} A list of the arguments used to create the rxDll object. } } \description{ diff --git a/man/rxModelVars.Rd b/man/rxModelVars.Rd index 8666a7baa..1b0f2b68f 100644 --- a/man/rxModelVars.Rd +++ b/man/rxModelVars.Rd @@ -21,17 +21,17 @@ rxModelVarsS3(obj) \value{ A list of rxode2 model properties including: \itemize{ -\item \code{params}{ a character vector of names of the model parameters} -\item \code{lhs}{ a character vector of the names of the model calculated parameters} -\item \code{state}{ a character vector of the compartments in rxode2 object} -\item \code{trans}{ a named vector of translated model properties +\item \code{params} a character vector of names of the model parameters +\item \code{lhs} a character vector of the names of the model calculated parameters +\item \code{state} a character vector of the compartments in rxode2 object +\item \code{trans} a named vector of translated model properties including what type of jacobian is specified, the \code{C} function prefixes, -as well as the \code{C} functions names to be called through the compiled model.} -\item \code{md5}{a named vector that gives the digest of the model (\code{file_md5}) and the parsed model -(\code{parsed_md5})} -\item \code{model}{ a named vector giving the input model (\code{model}), +as well as the \code{C} functions names to be called through the compiled model. +\item \code{md5} a named vector that gives the digest of the model (\code{file_md5}) and the parsed model +(\code{parsed_md5}) +\item \code{model} a named vector giving the input model (\code{model}), normalized model (no comments and standard syntax for parsing, \code{normModel}), -and interim code that is used to generate the final C file \code{parseModel}} +and interim code that is used to generate the final C file \code{parseModel} } } \description{ diff --git a/man/rxSetPipingAuto.Rd b/man/rxSetPipingAuto.Rd index 28225894b..c48a282e9 100644 --- a/man/rxSetPipingAuto.Rd +++ b/man/rxSetPipingAuto.Rd @@ -7,7 +7,7 @@ rxSetPipingAuto( thetamodelVars = rex::rex(or("tv", "t", "pop", "POP", "Pop", "TV", "T", "cov", "err", "eff")), - covariateExceptions = rex::rex(start, or("wt", "sex", "crcl"), end), + covariateExceptions = rex::rex(start, or("wt", "sex", "crcl", "kout"), end), etaParts = c("eta", "ETA", "Eta", "ppv", "PPV", "Ppv", "iiv", "Iiv", "bsv", "Bsv", "BSV", "bpv", "Bpv", "BPV", "psv", "PSV", "Psv") ) diff --git a/man/rxode2.Rd b/man/rxode2.Rd index 215a15ee6..d6a9d2d65 100644 --- a/man/rxode2.Rd +++ b/man/rxode2.Rd @@ -333,7 +333,7 @@ compilation model. \if{html}{\out{