Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into testthat3
Browse files Browse the repository at this point in the history
  • Loading branch information
billdenney committed Jan 14, 2022
2 parents fc9ccad + 82fa571 commit 55e770d
Show file tree
Hide file tree
Showing 32 changed files with 60 additions and 3,101 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ S3method(nmObjGetControl,fo)
S3method(nmObjGetControl,foce)
S3method(nmObjGetControl,focei)
S3method(nmObjGetControl,foi)
S3method(nmObjGetControl,posthoc)
S3method(nmObjGetControl,saem)
S3method(nmObjGetEstimationModel,default)
S3method(nmObjGetEstimationModel,saem)
Expand Down
2 changes: 1 addition & 1 deletion R/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ bootstrapFit <- function(fit,
assign(".bootPlotData", .dataList, envir = fit$env)
}
## Update covariance estimate
.nm <- names(fit$theta)[!fit$skipCov[seq_along(fit$theta)]]
.nm <- names(fit$theta)[!fit$foceiSkipCov[seq_along(fit$theta)]]
.cov <- fit$bootSummary$omega$covMatrixCombined[.nm, .nm]
.setCov(fit, covMethod = .cov)
assign("covMethod", paste0("boot", fit$bootSummary$nboot), fit$env)
Expand Down
6 changes: 3 additions & 3 deletions R/broom.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ confint.nlmixr2FitCoreSilent <- confint.nlmixr2FitCore
if (!.shrink) {
.df <- .df[, names(.df) != "shrink"]
}
.ini <- x$uif$ini$err[!is.na(x$uif$ini$ntheta)]
.ini <- x$ui$iniDf$err[!is.na(x$ui$iniDf$ntheta)]
## effect group term estimate std.error statistic
.df <- data.frame(
effect = "fixed",
term = row.names(.df), .df, stringsAsFactors = FALSE
)
if (!.ranpar) {
.df <- .df[is.na(x$uif$ini$err[!is.na(x$uif$ini$ntheta)]), ]
.df <- .df[is.na(x$ui$iniDf$err[!is.na(x$ui$iniDf$ntheta)]), ]
} else {
.tmp <- x$uif$ini$err[!is.na(x$uif$ini$ntheta)]
.tmp <- x$ui$iniDf$err[!is.na(x$ui$iniDf$ntheta)]
.df <- .df[!is.na(.tmp), ]
.tmp <- .tmp[!is.na(.tmp)]
.df$group <- paste0("Residual(", .tmp, ")")
Expand Down
2 changes: 1 addition & 1 deletion R/focei.R
Original file line number Diff line number Diff line change
Expand Up @@ -2346,7 +2346,7 @@ attr(rxUiGet.foceiOptEnv, "desc") <- "Get focei optimization environment"
assign("est", est, envir=.ret)
assign("skipCov", .env$skipCov, envir=.ret)
nmObjHandleModelObject(.ret$model, .ret)
nmObjHandleControlObject(.ret$control, .ret)
nmObjHandleControlObject(get("control", envir=.ret), .ret)
if (.control$calcTables) {
.ret <- addTable(.ret, updateObject="no", keep=.ret$table$keep, drop=.ret$table$drop,
table=.ret$table)
Expand Down
4 changes: 4 additions & 0 deletions R/nmObjHandle.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ nmObjGetControl.foi <- nmObjGetControl.focei
#' @export
nmObjGetControl.fo <- nmObjGetControl.focei

#' @rdname nmObjGetControl
#' @export
nmObjGetControl.posthoc <- nmObjGetControl.focei

#' @rdname nmObjGetControl
#' @export
nmObjGetControl.saem <- function(x, ...) {
Expand Down
12 changes: 8 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ We recommend you have a look at [`rxode2`](https://nlmixr2.github.io/rxode2/arti

When on CRAN, you can install the released version of nlmixr from [CRAN](https://CRAN.R-project.org) with:

``` r
```{r eval=FALSE, echo=TRUE}
install.packages("nlmixr2")
```

And the development version from [GitHub](https://github.com/) with:
### Installing the Development Version

``` r
# install.packages("devtools")
First, install [rxode2](https://github.com/nlmixr2/rxode2#installation). If not on Windows, you will also need to follow the instructions to install [symengine](https://github.com/symengine/symengine.R#installation).

And then install the development version of nlmixr2 from [GitHub](https://github.com/) with:

```{r eval=FALSE, echo=TRUE}
if (!requireNamespace("devtools")) install.packages("devtools")
devtools::install_github("nlmixr2/nlmixr2")
```
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,17 @@ When on CRAN, you can install the released version of nlmixr from
install.packages("nlmixr2")
```

And the development version from [GitHub](https://github.com/) with:
### Installing the Development Version

First, install [rxode2](https://github.com/nlmixr2/rxode2#installation).
If not on Windows, you will also need to follow the instructions to
install
[symengine](https://github.com/symengine/symengine.R#installation).

And then install the development version of nlmixr2 from
[GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
if (!requireNamespace("devtools")) install.packages("devtools")
devtools::install_github("nlmixr2/nlmixr2")
```
6 changes: 3 additions & 3 deletions build/nsis.R
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ DeleteRegKey HKCU \"Software\\R-core\\Rtools\\<%=rtoolsver%>\"
SectionEnd"

buildInstaller <- function(name="nlmixr"){
rtools <- gsub("/", "\\", RxODE:::.rxRtoolsBaseWin(), fixed=TRUE);
python <- gsub("/", "\\", RxODE:::.rxPythonBaseWin(), fixed=TRUE);
rtools <- gsub("/", "\\", rxode2:::.rxRtoolsBaseWin(), fixed=TRUE);
python <- gsub("/", "\\", rxode2:::.rxPythonBaseWin(), fixed=TRUE);
R <- gsub("/", "\\", Sys.getenv("R_HOME"), fixed=TRUE);
lic <- gsub("/", "\\", devtools::package_file("LICENSE"), fixed=TRUE);
readme <- gsub("/", "\\", devtools::package_file("build/installation-notes.rtf"), fixed=TRUE);
Expand All @@ -220,7 +220,7 @@ buildInstaller <- function(name="nlmixr"){
icon <- gsub("/", "\\", devtools::package_file("build/icon_red.ico"), fixed=TRUE)
rver <- paste(R.version$major,R.version$minor,sep=".");
## rtools.curr <- utils::readRegistry("SOFTWARE\\R-core\\Rtools", hive = "HLM", view = "32-bit", maxdepth = 2);
full.ver <- gsub("Rtools version ", "", readLines(file.path(RxODE:::.rxRtoolsBaseWin(), "VERSION.txt")))
full.ver <- gsub("Rtools version ", "", readLines(file.path(rxode2:::.rxRtoolsBaseWin(), "VERSION.txt")))
min.rver <- gsub("([0-9]+[.][0-9]+).*", "\\1", full.ver);
rtools.curr <- min.rver;
rtools.cur.ver <- rtools.curr
Expand Down
2 changes: 1 addition & 1 deletion man/addNpde.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/foceiControl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/nmObjGetControl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/vpcSim.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
32 changes: 0 additions & 32 deletions tests/testthat/test-307.R

This file was deleted.

7 changes: 6 additions & 1 deletion tests/testthat/test-autocovar.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
nlmixr2Test(
{
RxODE::.rxWithWd(tempdir(), {
<<<<<<< HEAD
rxode2::.rxWithWd(tempdir(), {
=======
context("autocovar")
rxode2::.rxWithWd(tempdir(), {
>>>>>>> origin/main

# === addCovariate
testthat::test_that("adding non-categorical covariate to funstring with log-transformation", {
Expand Down
109 changes: 0 additions & 109 deletions tests/testthat/test-back-transform.R

This file was deleted.

11 changes: 7 additions & 4 deletions tests/testthat/test-bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ nlmixr2Test(


test_that("resuming the fit should not return the same datasets as before", {

one.cmt <- function() {
ini({
## You may label each parameter with a comment
Expand Down Expand Up @@ -47,7 +48,7 @@ nlmixr2Test(
fit2 <- nlmixr2:::bootstrapFit(fit, nboot = 4, restart = FALSE)

output_dir <-
paste0("nlmixrBootstrapCache_", "fit", "_", fit$bootstrapMd5)
paste0("nlmixr2BootstrapCache_", "fit", "_", fit$bootstrapMd5)

fnameBootDataPattern <- paste0("boot_data",
"_", "[0-9]+", ".rds",
Expand All @@ -73,6 +74,7 @@ nlmixr2Test(
})

testthat::test_that("different confidence levels should result in different bands", {

one.cmt <- function() {
ini({
## You may label each parameter with a comment
Expand All @@ -96,7 +98,7 @@ nlmixr2Test(
})
}

fit <- suppressWarnings(nlmixr(
fit <- suppressWarnings(nlmixr2(
one.cmt,
samp_dat,
est = "focei",
Expand All @@ -119,6 +121,7 @@ nlmixr2Test(
})

testthat::test_that("expected columns in fit$parFixedDf object should match", {

one.cmt <- function() {
ini({
## You may label each parameter with a comment
Expand All @@ -142,7 +145,7 @@ nlmixr2Test(
})
}

fit <- suppressWarnings(nlmixr(
fit <- suppressWarnings(nlmixr2(
one.cmt,
samp_dat,
est = "focei",
Expand All @@ -160,7 +163,7 @@ nlmixr2Test(
testthat::expect_equal(colsAfter, colsBefore)

lapply(
list.files("./", pattern = "nlmixrBootstrapCache_.*"),
list.files("./", pattern = "nlmixr2BootstrapCache_.*"),
function(x) {
unlink(x, recursive = TRUE, force = TRUE)
}
Expand Down
Loading

0 comments on commit 55e770d

Please sign in to comment.