Package check result: OK Changes to worse in reverse depends: Package: aNCA Check: tests New result: ERROR Running ‘testthat.R’ [44s/44s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(shinytest2) > library(aNCA) > > test_check("aNCA") Joining with `by = join_by(ATPTREF)` * USUBJID -> id * PARAM -> analyte * DOSETRT -> drug * AVAL -> CONC * AVALU -> CONC_unit * DOSE -> dose * ADOSEDUR -> dosedur * AFRLT -> TIME * ATPTREF -> DOSNO Row 1: Converted volume from 1 L to 1000 mL based on concentration unit ug/mL Row 1: Converted volume from 2 mL to 2 g based on concentration unit mg/g Row 1: Converted volume from 1 L to 1000 mL based on concentration unit ug/mL Row 2: Converted volume from 0.5 mL to 0.5 g based on concentration unit mg/g Loading required namespace: ggh4x Saving _problems/test-pivot_wider_pknca_results-71.R Saving _problems/test-pivot_wider_pknca_results-85.R Saving _problems/test-pivot_wider_pknca_results-92.R Saving _problems/test-pivot_wider_pknca_results-119.R Saving _problems/test-pivot_wider_pknca_results-133.R Saving _problems/test-pivot_wider_pknca_results-147.R Saving _problems/test-pivot_wider_pknca_results-155.R Saving _problems/test-pivot_wider_pknca_results-206.R [ FAIL 8 | WARN 6 | SKIP 19 | PASS 733 ] ══ Skipped tests (19) ══════════════════════════════════════════════════════════ • On CRAN (16): 'test-g_pkcg.R:11:3', 'test-g_pkcg.R:25:3', 'test-g_pkcg.R:40:3', 'test-g_pkcg.R:74:3', 'test-g_pkcg.R:124:3', 'test-g_pkcg.R:132:3', 'test-g_pkcg.R:140:3', 'test-g_pkcg.R:161:3', 'test-g_pkcg.R:180:3', 'test-g_pkcg.R:213:3', 'test-g_pkcg.R:267:3', 'test-g_pkcg.R:279:3', 'test-read_pk.R:23:5', 'test-read_pk.R:36:5', 'test-read_pk.R:49:5', 'test-read_pk.R:62:5' • Skipping (1): 'test-e2e-runner.R:5:3' • empty test (2): 'test-PKNCA.R:249:3', 'test-calculate_summary_stats.R:104:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Failure ('test-pivot_wider_pknca_results.R:71:3'): pivot_wider_pknca_results ── Expected `pivot_wider_pknca_results(pknca_res)` not to throw any errors. Actually got a with message: arguments imply differing number of rows: 1, 2, 7 ── Failure ('test-pivot_wider_pknca_results.R:85:5'): pivot_wider_pknca_results / produces a data.frame ── Expected `pivoted_res` to be an S3 object. Actual OO type: none. ── Error ('test-pivot_wider_pknca_results.R:92:5'): pivot_wider_pknca_results / produces a data.frame with expected format when only reshaping main intervals ── Error in ``[<-`(`*tmp*`, , mapping_cols, value = structure(list(AUCLST.hr.ng.mL..8 = c(8, 8), AUCLST.hr.ng.mL..5.4425290000238 = c(5.4425290000238, 5.4425290000238), AUCLST.hr.ng.mL..5.5675290000238 = c(5.5675290000238, 5.5675290000238), AUCLST.hr.ng.mL..14.5112775765674 = c(14.5112775765674, 14.5112775765674), AUCLST.hr.ng.mL..14.5112775765674.1 = c(14.5112775765674, 14.5112775765674), AUCLST.hr.ng.mL..9 = c(9, 9), AUCLST.hr.ng.mL..5.07253965992077 = c(5.07253965992077, 5.07253965992077), CMAX.ng.mL..4 = c(4, 4), CMAX.ng.mL..2 = c(2, 2), CMAX.ng.mL..2.1 = c(2, 2), CMAX.ng.mL..5.59016994374947 = c(5.59016994374947, 5.59016994374947), CMAX.ng.mL..5.59016994374947.1 = c(5.59016994374947, 5.59016994374947), CMAX.ng.mL..2.2 = c(2, 2), CMAX.ng.mL..2.5 = c(2.5, 2.5), TMAX.hr..4 = c(4, 4), TMAX.hr..1.5 = c(1.5, 1.5), TMAX.hr..1.5.1 = c(1.5, 1.5), TMAX.hr..0 = c(0, 0), TMAX.hr..0.1 = c(0, 0), TMAX.hr..c.0..0. = c(0, 0), TMAX.hr..1.5.2 = c(1.5, 1.5), TLST.hr..4 = c(4, 4), TLST.hr..4.5 = c(4.5, 4.5), TLST.hr..4.5.1 = c(4.5, 4.5), TLST.hr..4.5.2 = c(4.5, 4.5), TLST.hr..4.5.3 = c(4.5, 4.5), TLST.hr..c.4.5..4.5. = c(4.5, 4.5), TLST.hr..4.5.4 = c(4.5, 4.5), CLST.ng.mL..4 = c(4, 4), CLST.ng.mL..0.5 = c(0.5, 0.5), CLST.ng.mL..0.5.1 = c(0.5, 0.5), CLST.ng.mL..1 = c(1, 1), CLST.ng.mL..1.1 = c(1, 1), CLST.ng.mL..2 = c(2, 2), CLST.ng.mL..0.5.2 = c(0.5, 0.5), LAMZ.1.hr..NA_real_ = c(NA_real_, NA_real_), LAMZ.1.hr..0.549306144334055 = c(0.549306144334055, 0.549306144334055), LAMZ.1.hr..0.549306144334055.1 = c(0.549306144334055, 0.549306144334055), LAMZ.1.hr..0.549306144334055.2 = c(0.549306144334055, 0.549306144334055), LAMZ.1.hr..0.549306144334055.3 = c(0.549306144334055, 0.549306144334055), LAMZ.1.hr..NA_real_.1 = c(NA_real_, NA_real_), LAMZ.1.hr..0.346573590279973 = c(0.346573590279973, 0.346573590279973), R2.NA_real_ = c(NA_real_, NA_real_), R2.0.977653958518262 = c(0.977653958518262, 0.977653958518262), R2.0.977653958518262.1 = c(0.977653958518262, 0.977653958518262), R2.0.977653958518262.2 = c(0.977653958518262, 0.977653958518262 ), R2.0.977653958518262.3 = c(0.977653958518262, 0.977653958518262), R2.NA_real_.1 = c(NA_real_, NA_real_), R2.0.99971691034068 = c(0.99971691034068, 0.99971691034068), R2ADJ.NA_real_ = c(NA_real_, NA_real_), R2ADJ.0.955307917036524 = c(0.955307917036524, 0.955307917036524), R2ADJ.0.955307917036524.1 = c(0.955307917036524, 0.955307917036524), R2ADJ.0.955307917036524.2 = c(0.955307917036524, 0.955307917036524), R2ADJ.0.955307917036524.3 = c(0.955307917036524, 0.955307917036524), R2ADJ.NA_real_.1 = c(NA_real_, NA_real_), R2ADJ.0.999433820681361 = c(0.999433820681361, 0.999433820681361), lambda.z.corrxy.NA_real_ = c(NA_real_, NA_real_), lambda.z.corrxy..0.988763853768058 = c(-0.988763853768058, -0.988763853768058), lambda.z.corrxy..0.988763853768058.1 = c(-0.988763853768058, -0.988763853768058), lambda.z.corrxy..0.988763853768058.2 = c(-0.988763853768058, -0.988763853768058), lambda.z.corrxy..0.988763853768058.3 = c(-0.988763853768058, -0.988763853768058), lambda.z.corrxy.NA_real_.1 = c(NA_real_, NA_real_ ), lambda.z.corrxy..0.999858445151453 = c(-0.999858445151453, -0.999858445151453), LAMZLL.hr..NA_real_ = c(NA_real_, NA_real_), LAMZLL.hr..2.5 = c(2.5, 2.5), LAMZLL.hr..2.5.1 = c(2.5, 2.5), LAMZLL.hr..2.5.2 = c(2.5, 2.5), LAMZLL.hr..2.5.3 = c(2.5, 2.5), LAMZLL.hr..NA_real_.1 = c(NA_real_, NA_real_), LAMZLL.hr..2.5.4 = c(2.5, 2.5), LAMZUL.hr..NA_real_ = c(NA_real_, NA_real_), LAMZUL.hr..4.5 = c(4.5, 4.5), LAMZUL.hr..4.5.1 = c(4.5, 4.5), LAMZUL.hr..4.5.2 = c(4.5, 4.5), LAMZUL.hr..4.5.3 = c(4.5, 4.5 ), LAMZUL.hr..NA_real_.1 = c(NA_real_, NA_real_), LAMZUL.hr..4.5.4 = c(4.5, 4.5), LAMZNPT.count..NA_real_ = c(NA_real_, NA_real_), LAMZNPT.count..3 = c(3, 3), LAMZNPT.count..3.1 = c(3, 3), LAMZNPT.count..3.2 = c(3, 3), LAMZNPT.count..3.3 = c(3, 3), LAMZNPT.count..NA_real_.1 = c(NA_real_, NA_real_), LAMZNPT.count..3.4 = c(3, 3), CLSTP.ng.mL..NA_real_ = c(NA_real_, NA_real_), CLSTP.ng.mL..0.524557531710824 = c(0.524557531710824, 0.524557531710824), CLSTP.ng.mL..0.524557531710824.1 = c(0.524557531710824, 0.524557531710824), CLSTP.ng.mL..1.04911506342165 = c(1.04911506342165, 1.04911506342165), CLSTP.ng.mL..1.04911506342165.1 = c(1.04911506342165, 1.04911506342165), CLSTP.ng.mL..NA_real_.1 = c(NA_real_, NA_real_), CLSTP.ng.mL..0.498319272249044 = c(0.498319272249044, 0.498319272249044), LAMZHL.hr..NA_real_ = c(NA_real_, NA_real_), LAMZHL.hr..1.26185950714292 = c(1.26185950714292, 1.26185950714292), LAMZHL.hr..1.26185950714292.1 = c(1.26185950714292, 1.26185950714292), LAMZHL.hr..1.26185950714292.2 = c(1.26185950714292, 1.26185950714292), LAMZHL.hr..1.26185950714292.3 = c(1.26185950714292, 1.26185950714292), LAMZHL.hr..NA_real_.1 = c(NA_real_, NA_real_), LAMZHL.hr..2 = c(2, 2), LAMZSPN.NA_real_ = c(NA_real_, NA_real_), LAMZSPN.1.58496250072116 = c(1.58496250072116, 1.58496250072116), LAMZSPN.1.58496250072116.1 = c(1.58496250072116, 1.58496250072116), LAMZSPN.1.58496250072116.2 = c(1.58496250072116, 1.58496250072116), LAMZSPN.1.58496250072116.3 = c(1.58496250072116, 1.58496250072116), LAMZSPN.NA_real_.1 = c(NA_real_, NA_real_), LAMZSPN.1 = c(1, 1), AUCIFO.hr.ng.mL..NA_real_ = c(NA_real_, NA_real_), AUCIFO.hr.ng.mL..6.35276822665064 = c(6.35276822665064, 6.35276822665064), AUCIFO.hr.ng.mL..6.47776822665064 = c(6.47776822665064, 6.47776822665064), AUCIFO.hr.ng.mL..16.3317560298211 = c(16.3317560298211, 16.3317560298211), AUCIFO.hr.ng.mL..16.3317560298211.1 = c(16.3317560298211, 16.3317560298211), AUCIFO.hr.ng.mL..NA_real_.1 = c(NA_real_, NA_real_), AUCIFO.hr.ng.mL..6.51523470080973 = c(6.51523470080973, 6.51523470080973 )), class = "data.frame", row.names = c(NA, -2L)))`: Assigned data `as.data.frame(...)` must be compatible with existing data. x Existing data has 7 rows. x Element 1 of assigned data has 2 rows. i Only vectors of size 1 are recycled. Caused by error in `vectbl_recycle_rhs_rows()`: ! Can't recycle input of size 2 to size 7. ── Failure ('test-pivot_wider_pknca_results.R:119:5'): pivot_wider_pknca_results / reshapes PKNCA results correctly when also considering AUC intervals ── Expected `pivoted_res` to be an S3 object. Actual OO type: none. ── Error ('test-pivot_wider_pknca_results.R:133:5'): pivot_wider_pknca_results / reshapes PKNCA results correctly when also considering AUC intervals ── Error in `expect_setequal(colnames(pivoted_res), expected_colnames)`: `object` must be a vector, not `NULL`. Backtrace: ▆ 1. └─testthat::expect_setequal(object = colnames(pivoted_res)) at test-pivot_wider_pknca_results.R:133:5 2. └─testthat:::check_vector(act$val, error_arg = "object") 3. └─testthat:::stop_input_type(x, "a vector", arg = error_arg, call = error_call) 4. └─rlang::abort(message, ..., call = call, arg = arg) ── Error ('test-pivot_wider_pknca_results.R:147:5'): pivot_wider_pknca_results / rounds numeric values to three decimals ── Error in `round(actual_values, 3)`: non-numeric argument to mathematical function ── Error ('test-pivot_wider_pknca_results.R:155:5'): pivot_wider_pknca_results / adds appropriate labels to columns (CDISC PPTEST) ── Error in `formatters::var_labels(pivoted_res)`: is.data.frame(x) is not TRUE Backtrace: ▆ 1. └─formatters::var_labels(pivoted_res) at test-pivot_wider_pknca_results.R:155:5 2. └─base::stopifnot(is.data.frame(x)) ── Error ('test-pivot_wider_pknca_results.R:206:5'): pivot_wider_pknca_results / excludes the presence of the column PPANMETH ── 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) { 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 } 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 })(`AUCLST[hr*ng/mL]` = structure(list(8, 5.4425290000238, 5.5675290000238, 14.5112775765674, 14.5112775765674, 9, 5.07253965992077), label = "AUC to Last Nonzero Conc"), `CMAX[ng/mL]` = structure(list(4, 2, 2, 5.59016994374947, 5.59016994374947, 2, 2.5), label = "Max Conc"), `TMAX[hr]` = structure(list(4, 1.5, 1.5, 0, 0, c(0, 0), 1.5), label = "Time of CMAX"), `TLST[hr]` = structure(list(4, 4.5, 4.5, 4.5, 4.5, c(4.5, 4.5), 4.5), label = "Time of Last Nonzero Conc"), `CLST[ng/mL]` = structure(list( 4, 0.5, 0.5, 1, 1, 2, 0.5), label = "Last Nonzero Conc"), `LAMZ[1/hr]` = structure(list(NA_real_, 0.549306144334055, 0.549306144334055, 0.549306144334055, 0.549306144334055, NA_real_, 0.346573590279973), label = "Lambda z"), R2 = structure(list(NA_real_, 0.977653958518262, 0.977653958518262, 0.977653958518262, 0.977653958518262, NA_real_, 0.99971691034068), label = "R Squared"), R2ADJ = structure(list(NA_real_, 0.955307917036524, 0.955307917036524, 0.955307917036524, 0.955307917036524, NA_real_, 0.999433820681361), label = "R Squared Adjusted"), lambda.z.corrxy = structure(list(NA_real_, -0.988763853768058, -0.988763853768058, -0.988763853768058, -0.988763853768058, NA_real_, -0.999858445151453), label = "lambda.z.corrxy"), `LAMZLL[hr]` = structure(list(NA_real_, 2.5, 2.5, 2.5, 2.5, NA_real_, 2.5), label = "Lambda z Lower Limit"), `LAMZUL[hr]` = structure(list(NA_real_, 4.5, 4.5, 4.5, 4.5, NA_real_, 4.5), label = "Lambda z Upper Limit"), `LAMZNPT[count]` = structure(list(NA_real_, 3, 3, 3, 3, NA_real_, 3), label = "Number of Points for Lambda z"), `CLSTP[ng/mL]` = structure(list(NA_real_, 0.524557531710824, 0.524557531710824, 1.04911506342165, 1.04911506342165, NA_real_, 0.498319272249044), label = "Clast pred"), `LAMZHL[hr]` = structure(list(NA_real_, 1.26185950714292, 1.26185950714292, 1.26185950714292, 1.26185950714292, NA_real_, 2), label = "Half-Life Lambda z"), LAMZSPN = structure(list(NA_real_, 1.58496250072116, 1.58496250072116, 1.58496250072116, 1.58496250072116, NA_real_, 1), label = "Lambda z Span"), `AUCIFO[hr*ng/mL]` = structure(list(NA_real_, 6.35276822665064, 6.47776822665064, 16.3317560298211, 16.3317560298211, NA_real_, 6.51523470080973), label = "AUC Infinity Obs"), `AUCINT_0-2[hr*ng/mL]` = structure(c(2, 2.681, 2.869, 7.594, 8.344, 3.5, 3.003), label = "AUC from T1 to T2"), `AUCINT_2-4[hr*ng/mL]` = structure(c(6, 2.462, 2.462, 4.925, 4.925, 4, 1.797), label = "AUC from T1 to T2"), check.names = TRUE, fix.empty.names = TRUE, stringsAsFactors = FALSE)`: arguments imply differing number of rows: 1, 2, 7 Backtrace: ▆ 1. └─aNCA::pivot_wider_pknca_results(res_with_ppanmeth) at test-pivot_wider_pknca_results.R:206:5 2. └─aNCA:::add_label_attribute(pivoted_res, myres) 3. ├─base::as.data.frame(...) 4. └─base::as.data.frame.list(...) 5. ├─base::do.call(data.frame, c(x, alis)) 6. └─base (local) ``(...) [ FAIL 8 | WARN 6 | SKIP 19 | PASS 733 ] Error: ! Test failures. Execution halted