Running ‘testthat.R’ [44s/66s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(xpose)
  Loading required package: ggplot2
  
  Attaching package: 'xpose'
  
  The following object is masked from 'package:stats':
  
      filter
  
  > 
  > test_check("xpose")
  [ FAIL 16 | WARN 0 | SKIP 4 | PASS 313 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (4)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-list_nm_tables.R:22:1'): (code run outside of `test_that()`) ───
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
      ▆
   1. └─xpose::read_nm_model(file = "run001.lst", dir = "data") at test-list_nm_tables.R:22:0
   2.   ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   3.   └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   4.     └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   5.       └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   6.         ├─base::withCallingHandlers(...)
   7.         └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-manual_import.R:5:1'): (code run outside of `test_that()`) ─────
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─... %>% dplyr::arrange_at(.vars = "table") at test-manual_import.R:5:0
    2. ├─dplyr::arrange_at(., .vars = "table")
    3. │ └─dplyr:::manip_at(...)
    4. │   └─dplyr:::tbl_at_syms(...)
    5. │     └─dplyr:::tbl_at_vars(...)
    6. │       └─dplyr::tbl_vars(tbl)
    7. │         ├─dplyr:::new_sel_vars(tbl_vars_dispatch(x), group_vars(x))
    8. │         │ └─base::structure(...)
    9. │         └─dplyr:::tbl_vars_dispatch(x)
   10. ├─dplyr::filter(., .$table == "sdtab001")
   11. └─xpose::xpose_data(...)
   12.   └─xpose::read_nm_model(file = basename(full_path), dir = dirname(full_path))
   13.     ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   14.     └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   15.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   16.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   17.           ├─base::withCallingHandlers(...)
   18.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-plots.R:21:1'): (code run outside of `test_that()`) ────────────
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
      ▆
   1. └─xpose::xpose_data(file = "sim.lst", dir = "data", quiet = TRUE) at test-plots.R:21:0
   2.   └─xpose::read_nm_model(file = basename(full_path), dir = dirname(full_path))
   3.     ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   4.     └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   5.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   6.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   7.           ├─base::withCallingHandlers(...)
   8.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-read_nm_files.R:34:3'): read_nm_files handles one file with inappropriate format ──
  <dplyr:::mutate_error/rlang_error/error/condition>
  Error in `dplyr::mutate(., tmp = purrr::map(.$data, .f = parse_nm_files, 
      quiet))`: ℹ In argument: `tmp = purrr::map(.$data, .f = parse_nm_files, quiet)`.
  Caused by error in `purrr::map()`:
  ℹ In index: 1.
  Caused by error in `vectbl_assign()`:
  ! DLL requires the use of native symbols
  ── Error ('test-read_nm_model.R:19:3'): properly parses a model given via the file and dir arguments ──
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test-read_nm_model.R:19:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. └─xpose::read_nm_model(file = "run001.lst", dir = "data")
    5.   ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    6.   └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    7.     └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
    8.       └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
    9.         ├─base::withCallingHandlers(...)
   10.         └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-read_nm_model.R:23:3'): properly parses a model given via the runno and dir arguments ──
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test-read_nm_model.R:23:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. └─xpose::read_nm_model(runno = "001", ext = ".lst", dir = "data")
    5.   ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    6.   └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    7.     └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
    8.       └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
    9.         ├─base::withCallingHandlers(...)
   10.         └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-read_nm_model.R:27:3'): properly handles missing code in output file ──
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-read_nm_model.R:27:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─xpose::read_nm_model(runno = "002", ext = ".lst", dir = "data")
    7.   ├─base::`[<-`(...)
    8.   └─tibble:::`[<-.tbl_df`(...)
    9.     └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   10.       └─tibble:::tbl_subassign_row(xj, i, value, i_arg, value_arg, call)
   11.         ├─base::withCallingHandlers(...)
   12.         └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-read_nm_model.R:37:3'): problem record is present even if no text has been supplied ──
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─testthat::expect_true(...) at test-read_nm_model.R:37:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─"pro" %in% ...
    5. └─xpose::read_nm_model(file = "sim.lst", dir = "data")
    6.   ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    7.   └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    8.     └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
    9.       └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   10.         ├─base::withCallingHandlers(...)
   11.         └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-set_vars.R:22:3'): set_vars_units and set_vars_label works properly ──
  <dplyr:::mutate_error/rlang_error/error/condition>
  Error in `dplyr::mutate(., out = purrr::map_if(.$tmp, .$grouping %in% .problem, 
      function(x, args, quiet) {
          index <- x$index[[1]]
          if (any(!args$col %in% index$col)) {
              warning(c("In $prob no.", x$problem, " columns: ", 
                  stringr::str_c(args$col[!args$col %in% index$col], 
                    collapse = ", "), " not present in the data."), 
                  call. = FALSE)
              args <- dplyr::filter(.data = args, args$col %in% 
                  index$col)
          }
          index[match(args$col, index$col), what] <- args$variable
          x$index[[1]] <- index
          x
      }, args = args, quiet = quiet))`: ℹ In argument: `out = purrr::map_if(...)`.
  Caused by error in `map()`:
  ℹ In index: 1.
  Caused by error in `vectbl_assign()`:
  ! DLL requires the use of native symbols
  ── Error ('test-vpc.R:15:1'): (code run outside of `test_that()`) ──────────────
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. └─xpose::vpc_data(xpdb_ex_pk, psn_folder = "data/psn_vpc/", quiet = TRUE) at test-vpc.R:15:0
    2.   ├─vpc::vpc(...)
    3.   ├─vpc:::vpc.default(...)
    4.   │ └─base::do.call(...)
    5.   └─vpc (local) `<fn>`(...)
    6.     ├─base::`[<-`(`*tmp*`, obs$pred != 0, , value = `<gropd_df[,10]>`)
    7.     ├─dplyr:::`[<-.grouped_df`(`*tmp*`, obs$pred != 0, , value = `<gropd_df[,10]>`)
    8.     ├─base::NextMethod()
    9.     └─tibble:::`[<-.tbl_df`(`*tmp*`, obs$pred != 0, , value = `<gropd_df[,10]>`)
   10.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   11.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   12.           ├─base::withCallingHandlers(...)
   13.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-xpdb_access.R:171:3'): get_prm works properly ──────────────────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(., .f = function(data) {
      prm_mean <- grab_iter(ext = data$ext, iter = -1e+09)
      prm_se <- grab_iter(ext = data$ext, iter = -1000000001)
      prm_fix <- grab_iter(ext = data$ext, iter = -1000000006)
      if (all(is.na(prm_fix))) {
          warning("Iteration `-1000000006` not found in the `.ext` file. Assuming no fixed parameters, check the output carefully.", 
              call. = FALSE)
          prm_fix[is.na(prm_fix)] <- 0
      }
      if (transform) {
          if (!is.null(data$cov)) {
              prm_cov <- as.data.frame(data$cov) %>% tibble::column_to_rownames("NAME") %>% 
                  as.matrix()
          }
          else {
              prm_cov <- diag(prm_se)^2
              attr(prm_cov, "dimnames") <- list(names(prm_se), 
                  names(prm_se))
              if (!all(is.na(prm_se))) {
                  warning("Covariance matrix (`.cov`) not available, RSE for covariance parameters will be incorrect.", 
                    call. = FALSE)
              }
          }
          prm_trans_formula <- get_prm_transformation_formulas(names(prm_mean))
          prms <- purrr::map_df(prm_trans_formula, ~transform_prm(.x, 
              mu = prm_mean, sigma = prm_cov, method = "delta")) %>% 
              dplyr::mutate(se = sqrt(.$variance))
      }
      else {
          prms <- dplyr::tibble(mean = purrr::flatten_dbl(prm_mean), 
              se = purrr::flatten_dbl(prm_se)) %>% dplyr::mutate(rse = .$se/abs(.$mean))
      }
      prms <- prms %>% dplyr::mutate(fixed = as.logical(as.numeric(prm_fix)), 
          name = names(prm_mean)) %>% dplyr::mutate(type = dplyr::case_when(stringr::str_detect(.$name, 
          "THETA") ~ "the", stringr::str_detect(.$name, "OMEGA") ~ 
          "ome", stringr::str_detect(.$name, "SIGMA") ~ "sig"), 
          number = stringr::str_replace_all(.$name, "[^\\d,]+", 
              ""), se = ifelse(.$fixed, NA_real_, as.numeric(.$se)), 
          rse = ifelse(.$fixed, NA_real_, abs(as.numeric(.$rse)))) %>% 
          tidyr::separate(col = "number", into = c("m", "n"), sep = ",", 
              fill = "right") %>% dplyr::mutate(diagonal = dplyr::if_else(.$m == 
          .$n, TRUE, FALSE)) %>% dplyr::rename(`:=`(!!rlang::sym("value"), 
          !!rlang::sym("mean"))) %>% dplyr::mutate(label = "", 
          value = signif(.$value, digits = digits), se = signif(.$se, 
              digits = digits), rse = signif(.$rse, digits = digits), 
          n = as.numeric(.$n), m = as.numeric(.$m), order = dplyr::case_when(type == 
              "the" ~ 1, type == "ome" ~ 2, TRUE ~ 3)) %>% dplyr::arrange_at(.vars = "order") %>% 
          dplyr::select(dplyr::one_of("type", "name", "label", 
              "value", "se", "rse", "fixed", "diagonal", "m", "n"))
      n_theta <- sum(prms$type == "the")
      theta_names <- data$prm_names$theta
      if (n_theta != length(theta_names)) {
          warning("[$prob no.", data$problem, ", subprob no.", 
              data$subprob, ", ", data$method, "] $THETA labels did not match the number of THETAs in the `.ext` file.", 
              call. = FALSE)
      }
      else {
          prms$label[prms$type == "the"] <- theta_names
      }
      n_omega <- sum(prms$type == "ome" & prms$diagonal, na.rm = TRUE)
      omega_names <- data$prm_names$omega
      if (n_omega != length(omega_names)) {
          warning("[$prob no.", data$problem, ", subprob no.", 
              data$subprob, ", ", data$method, "] $OMEGA labels did not match the number of OMEGAs in the `.ext` file.", 
              call. = FALSE)
      }
      else {
          prms$label[prms$type == "ome" & prms$diagonal] <- omega_names
      }
      n_sigma <- sum(prms$type == "sig" & prms$diagonal, na.rm = TRUE)
      sigma_names <- data$prm_names$sigma
      if (n_sigma != length(sigma_names)) {
          warning("[$prob no.", data$problem, ", subprob no.", 
              data$subprob, ", ", data$method, "] $SIGMA labels did not match the number of SIGMAs in the `.ext` file.", 
              call. = FALSE)
      }
      else {
          prms$label[prms$type == "sig" & prms$diagonal] <- sigma_names
      }
      if (!show_all) {
          prms <- dplyr::filter(.data = prms, !(prms$type %in% 
              c("ome", "sig") & prms$value == 0 & !prms$diagonal))
      }
      structure(.Data = prms, file = "ext", problem = data$problem, 
          subprob = data$subprob, method = data$method)
  })`: ℹ In index: 1.
  Caused by error in `vectbl_assign()`:
  ! DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─... %>% get_prm(transform = FALSE, quiet = TRUE) at test-xpdb_access.R:171:2
    2. ├─xpose::get_prm(., transform = FALSE, quiet = TRUE)
    3. │ └─... %>% ...
    4. ├─purrr::map(...)
    5. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
    6. │   ├─purrr:::with_indexed_errors(...)
    7. │   │ └─base::withCallingHandlers(...)
    8. │   ├─purrr:::call_with_cleanup(...)
    9. │   └─xpose (local) .f(.x[[i]], ...)
   10. │     └─xpose::grab_iter(ext = data$ext, iter = -1000000001)
   11. │       ├─base::`[<-`(`*tmp*`, 1, , value = `<dbl>`)
   12. │       └─tibble:::`[<-.tbl_df`(`*tmp*`, 1, , value = `<dbl>`)
   13. │         └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   14. │           └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   15. │             ├─base::withCallingHandlers(...)
   16. │             └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
   17. └─base::.handleSimpleError(...)
   18.   └─purrr (local) h(simpleError(msg, call))
   19.     └─cli::cli_abort(...)
   20.       └─rlang::abort(...)
  ── Error ('test-xpose_data.R:28:3'): properly creates the xpdb when using the file argument ──
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
      ▆
   1. └─xpose::xpose_data(file = "run001.lst", dir = "data", quiet = TRUE) at test-xpose_data.R:28:2
   2.   └─xpose::read_nm_model(file = basename(full_path), dir = dirname(full_path))
   3.     ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   4.     └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   5.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   6.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   7.           ├─base::withCallingHandlers(...)
   8.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-xpose_data.R:44:3'): properly creates the xpdb when using the runno argument ──
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
      ▆
   1. └─xpose::xpose_data(...) at test-xpose_data.R:44:2
   2.   └─xpose::read_nm_model(file = basename(full_path), dir = dirname(full_path))
   3.     ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   4.     └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   5.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   6.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   7.           ├─base::withCallingHandlers(...)
   8.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-xpose_data.R:60:3'): properly handles errors in tables ─────────
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-xpose_data.R:60:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─xpose::xpose_data(...)
    7.   └─xpose::read_nm_model(file = basename(full_path), dir = dirname(full_path))
    8.     ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    9.     └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   10.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   11.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   12.           ├─base::withCallingHandlers(...)
   13.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-xpose_data.R:71:3'): properly handles errors in summary ────────
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-xpose_data.R:71:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─xpose::xpose_data(...)
    7.   └─xpose::read_nm_model(file = basename(full_path), dir = dirname(full_path))
    8.     ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    9.     └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   10.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   11.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   12.           ├─base::withCallingHandlers(...)
   13.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  ── Error ('test-xpose_data.R:79:3'): properly handles errors in files ──────────
  Error in `vectbl_assign(x[[j]], i, recycled_value[[j]])`: DLL requires the use of native symbols
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-xpose_data.R:79:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─xpose::xpose_data(...)
    7.   └─xpose::read_nm_model(file = basename(full_path), dir = dirname(full_path))
    8.     ├─base::`[<-`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
    9.     └─tibble:::`[<-.tbl_df`(`*tmp*`, lst_rows, , value = `<tibble[,4]>`)
   10.       └─tibble:::tbl_subassign(x, i, j, value, i_arg, j_arg, substitute(value))
   11.         └─tibble:::tbl_subassign_row(xo, i, value, i_arg, value_arg, call)
   12.           ├─base::withCallingHandlers(...)
   13.           └─tibble:::vectbl_assign(x[[j]], i, recycled_value[[j]])
  
  [ FAIL 16 | WARN 0 | SKIP 4 | PASS 313 ]
  Error: Test failures
  Execution halted