Running ‘testthat.R’ [19s/33s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(rxode2)
  rxode2 2.0.12 using 3 threads (see ?getRxThreads)
    no cache: create with `rxCreateCache()`
  > library(nlmixr2est)
  Loading required package: nlmixr2data
  > verbose_minimization <- FALSE
  > test_check("nlmixr2est")
  
  R Under development (unstable) (2023-03-29 r84123) -- "Unsuffered Consequences"
  Copyright (C) 2023 The R Foundation for Statistical Computing
  Platform: x86_64-pc-linux-gnu (64-bit)
  
  R is free software and comes with ABSOLUTELY NO WARRANTY.
  You are welcome to redistribute it under certain conditions.
  Type 'license()' or 'licence()' for distribution details.
  
    Natural language support but running in an English locale
  
  R is a collaborative project with many contributors.
  Type 'contributors()' for more information and
  'citation()' on how to cite R or R packages in publications.
  
  Type 'demo()' for some demos, 'help()' for on-line help, or
  'help.start()' for an HTML browser interface to help.
  Type 'q()' to quit R.
  
  >     library(nlmixr2est)
  Loading required package: nlmixr2data
  >     rxode2::rxClean()
  >     one.cmt <- function() {
  +         ini({
  +             tka <- 0.45
  +             tcl <- log(c(0, 2.7, 100))
  +             tv <- 3.45
  +             label("log V")
  +             eta.ka ~ 0.6
  +             eta.cl ~ 0.3
  +             eta.v ~ 0.1
  +             add.sd <- 0.7
  +         })
  +         model({
  +             ka <- exp(tka + eta.ka)
  +             cl <- exp(tcl + eta.cl)
  +             v <- exp(tv + eta.v)
  +             linCmt() ~ add(add.sd)
  +         })
  +     }
  >     fit <- nlmixr(one.cmt, theo_sd, est = "saem", control = saemControl(print = 0))
  ℹ parameter labels from comments are typically ignored in non-interactive mode
  ℹ Need to run with the source intact to parse comments
  Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
    arguments imply differing number of rows: 1, 0
  Error: arguments imply differing number of rows: 1, 0
  Execution halted
  Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
    arguments imply differing number of rows: 1, 0
  Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
    arguments imply differing number of rows: 1, 0
  i parameter labels from comments will be replaced by 'label()'
  using C compiler: ‘gcc-12 (Debian 12.2.0-14) 12.2.0’
  
  [ FAIL 5 | WARN 1 | SKIP 0 | PASS 145 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-00-reload-ll.R:33:3'): between session saem ll works ───────────
  Error in `gzfile(file, "rb")`: cannot open the connection
  Backtrace:
      ▆
   1. ├─withr::with_tempdir(...) at test-00-reload-ll.R:33:2
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. └─base::readRDS("fit.rds") at test-00-reload-ll.R:39:4
   5.   └─base::gzfile(file, "rb")
  ── Error ('test-focei-preprocess.R:44:3'): .foceiPreProcessData works with data.frame and tibble data ──
  Error in `(function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, 
      fix.empty.names = TRUE, stringsAsFactors = FALSE) 
  {
      data.row.names <- if (check.rows && is.null(row.names)) 
          function(current, new, i) {
              if (is.character(current)) 
                  new <- as.character(new)
              if (is.character(new)) 
                  current <- as.character(current)
              if (anyDuplicated(new)) 
                  return(current)
              if (is.null(current)) 
                  return(new)
              if (all(current == new) || all(current == "")) 
                  return(new)
              stop(gettextf("mismatch of row names in arguments of 'data.frame', item %d", 
                  i), domain = NA)
          }
      else function(current, new, i) {
          if (is.null(current)) {
              if (anyDuplicated(new)) {
                  warning(gettextf("some row.names duplicated: %s --> row.names NOT used", 
                    paste(which(duplicated(new)), collapse = ",")), 
                    domain = NA)
                  current
              }
              else new
          }
          else current
      }
      object <- as.list(substitute(list(...)))[-1L]
      mirn <- missing(row.names)
      mrn <- is.null(row.names)
      x <- list(...)
      n <- length(x)
      if (n < 1L) {
          if (!mrn) {
              if (is.object(row.names) || !is.integer(row.names)) 
                  row.names <- as.character(row.names)
              if (anyNA(row.names)) 
                  stop("row names contain missing values")
              if (anyDuplicated(row.names)) 
                  stop(gettextf("duplicate row.names: %s", paste(unique(row.names[duplicated(row.names)]), 
                    collapse = ", ")), domain = NA)
          }
          else row.names <- integer()
          return(structure(list(), names = character(), row.names = row.names, 
              class = "data.frame"))
      }
      vnames <- names(x)
      if (length(vnames) != n) 
          vnames <- character(n)
      no.vn <- !nzchar(vnames)
      vlist <- vnames <- as.list(vnames)
      nrows <- ncols <- integer(n)
      for (i in seq_len(n)) {
          xi <- if (is.character(x[[i]]) || is.list(x[[i]])) 
              as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
          else as.data.frame(x[[i]], optional = TRUE)
          nrows[i] <- .row_names_info(xi)
          ncols[i] <- length(xi)
          namesi <- names(xi)
          if (ncols[i] > 1L) {
              if (length(namesi) == 0L) 
                  namesi <- seq_len(ncols[i])
              vnames[[i]] <- if (no.vn[i]) 
                  namesi
              else paste(vnames[[i]], namesi, sep = ".")
          }
          else if (length(namesi)) {
              vnames[[i]] <- namesi
          }
          else if (fix.empty.names && no.vn[[i]]) {
              tmpname <- deparse(object[[i]], nlines = 1L)[1L]
              if (startsWith(tmpname, "I(") && endsWith(tmpname, 
                  ")")) {
                  ntmpn <- nchar(tmpname, "c")
                  tmpname <- substr(tmpname, 3L, ntmpn - 1L)
              }
              vnames[[i]] <- tmpname
          }
          if (mirn && nrows[i] > 0L) {
              rowsi <- attr(xi, "row.names")
              if (any(nzchar(rowsi))) 
                  row.names <- data.row.names(row.names, rowsi, 
                    i)
          }
          nrows[i] <- abs(nrows[i])
          vlist[[i]] <- xi
      }
      nr <- max(nrows)
      for (i in seq_len(n)[nrows < nr]) {
          xi <- vlist[[i]]
          if (nrows[i] > 0L && (nr%%nrows[i] == 0L)) {
              xi <- unclass(xi)
              fixed <- TRUE
              for (j in seq_along(xi)) {
                  xi1 <- xi[[j]]
                  if (is.vector(xi1) || is.factor(xi1)) 
                    xi[[j]] <- rep(xi1, length.out = nr)
                  else if (is.character(xi1) && inherits(xi1, "AsIs")) 
                    xi[[j]] <- structure(rep(xi1, length.out = nr), 
                      class = class(xi1))
                  else if (inherits(xi1, "Date") || inherits(xi1, 
                    "POSIXct")) 
                    xi[[j]] <- rep(xi1, length.out = nr)
                  else {
                    fixed <- FALSE
                    break
                  }
              }
              if (fixed) {
                  vlist[[i]] <- xi
                  next
              }
          }
          stop(gettextf("arguments imply differing number of rows: %s", 
              paste(unique(nrows), collapse = ", ")), domain = NA)
      }
      value <- unlist(vlist, recursive = FALSE, use.names = FALSE)
      vnames <- as.character(unlist(vnames[ncols > 0L]))
      if (fix.empty.names && any(noname <- !nzchar(vnames))) 
          vnames[noname] <- paste0("Var.", seq_along(vnames))[noname]
      if (check.names) {
          if (fix.empty.names) 
              vnames <- make.names(vnames, unique = TRUE)
          else {
              nz <- nzchar(vnames)
              vnames[nz] <- make.names(vnames[nz], unique = TRUE)
          }
      }
      names(value) <- vnames
      if (!mrn) {
          if (length(row.names) == 1L && nr != 1L) {
              if (is.character(row.names)) 
                  row.names <- match(row.names, vnames, 0L)
              if (length(row.names) != 1L || row.names < 1L || 
                  row.names > length(vnames)) 
                  stop("'row.names' should specify one of the variables")
              i <- row.names
              row.names <- value[[i]]
              value <- value[-i]
          }
          else if (!is.null(row.names) && length(row.names) != 
              nr) 
              stop("row names supplied are of the wrong length")
      }
      else if (!is.null(row.names) && length(row.names) != nr) {
          warning("row names were found from a short variable and have been discarded")
          row.names <- NULL
      }
      class(value) <- "data.frame"
      if (is.null(row.names)) 
          attr(value, "row.names") <- .set_row_names(nr)
      else {
          if (is.object(row.names) || !is.integer(row.names)) 
              row.names <- as.character(row.names)
          if (anyNA(row.names)) 
              stop("row names contain missing values")
          if (anyDuplicated(row.names)) 
              stop(gettextf("duplicate row.names: %s", paste(unique(row.names[duplicated(row.names)]), 
                  collapse = ", ")), domain = NA)
          row.names(value) <- row.names
      }
      value
  })(3L, NULL, check.names = FALSE, fix.empty.names = TRUE, stringsAsFactors = FALSE)`: arguments imply differing number of rows: 1, 0
  Backtrace:
       ▆
    1. └─nm$.foceiPreProcessData(data = df, env = env_orig, ui = ui) at test-focei-preprocess.R:44:2
    2.   └─base::cbind(as.data.frame(.et), .keepL)
    3.     └─base::cbind(deparse.level, ...)
    4.       └─base::data.frame(..., check.names = FALSE)
    5.         ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
    6.         └─base::as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
    7.           ├─base::do.call(data.frame, c(x, alis))
    8.           └─base (local) `<fn>`(...)
    9.             ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   10.             └─base::as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   11.               ├─base::do.call(data.frame, c(x, alis))
   12.               └─base (local) `<fn>`(...)
   13.                 ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   14.                 └─base::as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   15.                   ├─base::do.call(data.frame, c(x, alis))
   16.                   └─base (local) `<fn>`(...)
  ── Error ('test-focei-preprocess.R:54:3'): .foceiPreProcessData works with ID as character or factor ──
  Error in `(function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, 
      fix.empty.names = TRUE, stringsAsFactors = FALSE) 
  {
      data.row.names <- if (check.rows && is.null(row.names)) 
          function(current, new, i) {
              if (is.character(current)) 
                  new <- as.character(new)
              if (is.character(new)) 
                  current <- as.character(current)
              if (anyDuplicated(new)) 
                  return(current)
              if (is.null(current)) 
                  return(new)
              if (all(current == new) || all(current == "")) 
                  return(new)
              stop(gettextf("mismatch of row names in arguments of 'data.frame', item %d", 
                  i), domain = NA)
          }
      else function(current, new, i) {
          if (is.null(current)) {
              if (anyDuplicated(new)) {
                  warning(gettextf("some row.names duplicated: %s --> row.names NOT used", 
                    paste(which(duplicated(new)), collapse = ",")), 
                    domain = NA)
                  current
              }
              else new
          }
          else current
      }
      object <- as.list(substitute(list(...)))[-1L]
      mirn <- missing(row.names)
      mrn <- is.null(row.names)
      x <- list(...)
      n <- length(x)
      if (n < 1L) {
          if (!mrn) {
              if (is.object(row.names) || !is.integer(row.names)) 
                  row.names <- as.character(row.names)
              if (anyNA(row.names)) 
                  stop("row names contain missing values")
              if (anyDuplicated(row.names)) 
                  stop(gettextf("duplicate row.names: %s", paste(unique(row.names[duplicated(row.names)]), 
                    collapse = ", ")), domain = NA)
          }
          else row.names <- integer()
          return(structure(list(), names = character(), row.names = row.names, 
              class = "data.frame"))
      }
      vnames <- names(x)
      if (length(vnames) != n) 
          vnames <- character(n)
      no.vn <- !nzchar(vnames)
      vlist <- vnames <- as.list(vnames)
      nrows <- ncols <- integer(n)
      for (i in seq_len(n)) {
          xi <- if (is.character(x[[i]]) || is.list(x[[i]])) 
              as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
          else as.data.frame(x[[i]], optional = TRUE)
          nrows[i] <- .row_names_info(xi)
          ncols[i] <- length(xi)
          namesi <- names(xi)
          if (ncols[i] > 1L) {
              if (length(namesi) == 0L) 
                  namesi <- seq_len(ncols[i])
              vnames[[i]] <- if (no.vn[i]) 
                  namesi
              else paste(vnames[[i]], namesi, sep = ".")
          }
          else if (length(namesi)) {
              vnames[[i]] <- namesi
          }
          else if (fix.empty.names && no.vn[[i]]) {
              tmpname <- deparse(object[[i]], nlines = 1L)[1L]
              if (startsWith(tmpname, "I(") && endsWith(tmpname, 
                  ")")) {
                  ntmpn <- nchar(tmpname, "c")
                  tmpname <- substr(tmpname, 3L, ntmpn - 1L)
              }
              vnames[[i]] <- tmpname
          }
          if (mirn && nrows[i] > 0L) {
              rowsi <- attr(xi, "row.names")
              if (any(nzchar(rowsi))) 
                  row.names <- data.row.names(row.names, rowsi, 
                    i)
          }
          nrows[i] <- abs(nrows[i])
          vlist[[i]] <- xi
      }
      nr <- max(nrows)
      for (i in seq_len(n)[nrows < nr]) {
          xi <- vlist[[i]]
          if (nrows[i] > 0L && (nr%%nrows[i] == 0L)) {
              xi <- unclass(xi)
              fixed <- TRUE
              for (j in seq_along(xi)) {
                  xi1 <- xi[[j]]
                  if (is.vector(xi1) || is.factor(xi1)) 
                    xi[[j]] <- rep(xi1, length.out = nr)
                  else if (is.character(xi1) && inherits(xi1, "AsIs")) 
                    xi[[j]] <- structure(rep(xi1, length.out = nr), 
                      class = class(xi1))
                  else if (inherits(xi1, "Date") || inherits(xi1, 
                    "POSIXct")) 
                    xi[[j]] <- rep(xi1, length.out = nr)
                  else {
                    fixed <- FALSE
                    break
                  }
              }
              if (fixed) {
                  vlist[[i]] <- xi
                  next
              }
          }
          stop(gettextf("arguments imply differing number of rows: %s", 
              paste(unique(nrows), collapse = ", ")), domain = NA)
      }
      value <- unlist(vlist, recursive = FALSE, use.names = FALSE)
      vnames <- as.character(unlist(vnames[ncols > 0L]))
      if (fix.empty.names && any(noname <- !nzchar(vnames))) 
          vnames[noname] <- paste0("Var.", seq_along(vnames))[noname]
      if (check.names) {
          if (fix.empty.names) 
              vnames <- make.names(vnames, unique = TRUE)
          else {
              nz <- nzchar(vnames)
              vnames[nz] <- make.names(vnames[nz], unique = TRUE)
          }
      }
      names(value) <- vnames
      if (!mrn) {
          if (length(row.names) == 1L && nr != 1L) {
              if (is.character(row.names)) 
                  row.names <- match(row.names, vnames, 0L)
              if (length(row.names) != 1L || row.names < 1L || 
                  row.names > length(vnames)) 
                  stop("'row.names' should specify one of the variables")
              i <- row.names
              row.names <- value[[i]]
              value <- value[-i]
          }
          else if (!is.null(row.names) && length(row.names) != 
              nr) 
              stop("row names supplied are of the wrong length")
      }
      else if (!is.null(row.names) && length(row.names) != nr) {
          warning("row names were found from a short variable and have been discarded")
          row.names <- NULL
      }
      class(value) <- "data.frame"
      if (is.null(row.names)) 
          attr(value, "row.names") <- .set_row_names(nr)
      else {
          if (is.object(row.names) || !is.integer(row.names)) 
              row.names <- as.character(row.names)
          if (anyNA(row.names)) 
              stop("row names contain missing values")
          if (anyDuplicated(row.names)) 
              stop(gettextf("duplicate row.names: %s", paste(unique(row.names[duplicated(row.names)]), 
                  collapse = ", ")), domain = NA)
          row.names(value) <- row.names
      }
      value
  })(3L, NULL, check.names = FALSE, fix.empty.names = TRUE, stringsAsFactors = FALSE)`: arguments imply differing number of rows: 1, 0
  Backtrace:
       ▆
    1. └─nm$.foceiPreProcessData(data = df, env = env_orig, ui = ui) at test-focei-preprocess.R:54:2
    2.   └─base::cbind(as.data.frame(.et), .keepL)
    3.     └─base::cbind(deparse.level, ...)
    4.       └─base::data.frame(..., check.names = FALSE)
    5.         ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
    6.         └─base::as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
    7.           ├─base::do.call(data.frame, c(x, alis))
    8.           └─base (local) `<fn>`(...)
    9.             ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   10.             └─base::as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   11.               ├─base::do.call(data.frame, c(x, alis))
   12.               └─base (local) `<fn>`(...)
   13.                 ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   14.                 └─base::as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
   15.                   ├─base::do.call(data.frame, c(x, alis))
   16.                   └─base (local) `<fn>`(...)
  ── Error ('test-nmobj.R:25:3'): nmObject get tests ─────────────────────────────
  Error: arguments imply differing number of rows: 1, 0
  Backtrace:
      ▆
   1. ├─base::suppressMessages(...) at test-nmobj.R:25:2
   2. │ └─base::withCallingHandlers(...)
   3. ├─base::suppressWarnings(...)
   4. │ └─base::withCallingHandlers(...)
   5. ├─nlmixr2est::nlmixr(one.cmt, nlmixr2data::theo_sd, est = "focei")
   6. └─nlmixr2est:::nlmixr2.function(...)
   7.   └─nlmixr2est:::nlmixr2Est0(.env)
  ── Error ('test-np.R:106:3'): parameters are updated in fit object ─────────────
  Error: arguments imply differing number of rows: 1, 0
  Backtrace:
      ▆
   1. ├─base::suppressMessages(...) at test-np.R:106:2
   2. │ └─base::withCallingHandlers(...)
   3. ├─base::suppressWarnings(...)
   4. │ └─base::withCallingHandlers(...)
   5. ├─nlmixr2est::nlmixr(one.cmt, nlmixr2data::theo_sd, "focei")
   6. └─nlmixr2est:::nlmixr2.function(...)
   7.   └─nlmixr2est:::nlmixr2Est0(.env)
  
  [ FAIL 5 | WARN 1 | SKIP 0 | PASS 145 ]
  Error: Test failures
  Execution halted