Skip to content

Commit

Permalink
Add to news; Also copy items into as.nonmem2rx if not explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Dec 8, 2023
1 parent bbbc957 commit 7855904
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nonmem2rx 0.1.3

* Added explicit requirement for rxode2 2.0.12
* Added explicit requirement for rxode2 2.0.13

* Added support of `DADT(#)` statements on the right side of the
equation, i.e. `DADT(3) = DADT(1) + DADT(2)` (#164)
Expand All @@ -11,6 +11,14 @@

* Fixed security related format issues as requested by CRAN #167

* Now `omega`, `thetaMat`, `dfObs` and `dfSub` are incorporated into
model function (by default). You can change this with the
`nonmem2rx` `keep` argument

* Using the `rxode2` 2.0.13 makes sure that the solves for models
where the endpoint is not determined in the typical `nlmixr2` style
will validate more often (due to a bug in solving in `rxode2`).

# nonmem2rx 0.1.2

* Added support for `ADVAN5` and `ADVAN7` models
Expand Down
14 changes: 13 additions & 1 deletion R/asNonmem2rx.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @examples
#'
#' \donttest{
#'
#'
#' mod <- nonmem2rx(system.file("mods/cpt/runODE032.ctl", package="nonmem2rx"),
#' determineError=FALSE, lst=".res", save=FALSE)
#'
Expand Down Expand Up @@ -66,10 +66,22 @@ as.nonmem2rx <- function(model1, model2, compress=TRUE) {
.cp <- c("sticky", "nonmemData", "atol", "rtol", "ssAtol", "ssRtol", "etaData",
"ipredData", "predData", "sigmaNames", "dfSub", "thetaMat", "dfObs",
"file", "outputExtension")
.meta <- new.env(parent=emptyenv())
if (exists("meta", envir=.nm2rx)) {
.meta <- get("meta", envir=.nm2rx)
}
.metaRx <- new.env(parent=emptyenv())
if (exists("meta", envir=.rx)) {
.metaRx <- get("meta", envir=.rx)
}
lapply(.cp, function(x) {
if (exists(x, envir=.nm2rx)) {
assign(x, get(x, envir=.nm2rx), envir=.rx)
}
if (exists(x, envir=.meta) && !exists(x, envir=.metaRx)) {
.minfo(paste0("copy '", x, "' to nonmem2rx model"))
assign(x, get(x, envir=.meta), envir=.metaRx)
}
})
.nonmemData <- .rx$nonmemData
.w <- which(names(.nonmemData) == "nmdvid")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-as-nonmem2rx.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
test_that("as.nonmem2rx", {
skip_on_cran()

mod <- nonmem2rx(system.file("mods/cpt/runODE032.ctl", package="nonmem2rx"),
determineError=FALSE, lst=".res", save=FALSE)

Expand Down

0 comments on commit 7855904

Please sign in to comment.