* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ecap.Rcheck’ * using R Under development (unstable) (2022-03-29 r82022) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘ecap/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘ecap’ version ‘0.1.2’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘ecap’ can be installed ... [8s/33s] OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [13s/63s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ [5s/16s] [5s/18s] ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(ecap) Loading required package: splines Loading required package: quadprog Loading required package: ggplot2 > > test_check("ecap") ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- splines --- call from context --- splines::splineDesign(Aknots, rep(k.pivot, 2L), 4, c(0, 1), derivs = deriv) --- call from argument --- !outer.ok && nk < 2 * ord - 1 --- R stacktrace --- where 1: splines::splineDesign(Aknots, rep(k.pivot, 2L), 4, c(0, 1), derivs = deriv) where 2: myns(fine_grid, knots = quantiles, intercept = T, Boundary.knots = knot.range) where 3: ecap(unadjusted_prob = p_obs, win_var = win_var, win_id = 1, bias_indicator = FALSE) where 4: doTryCatch(return(expr), name, parentenv, handler) where 5: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 6: tryCatchList(expr, classes, parentenv, handlers) where 7: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e)) }) where 8 at test-ecap.R#5: try(ecap(unadjusted_prob = p_obs, win_var = win_var, win_id = 1, bias_indicator = FALSE)) where 9: eval(code, test_env) where 10: eval(code, test_env) where 11: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() } }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error) where 12: doTryCatch(return(expr), name, parentenv, handler) where 13: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 14: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) where 15: doTryCatch(return(expr), name, parentenv, handler) where 16: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]]) where 17: tryCatchList(expr, classes, parentenv, handlers) where 18: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() } }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { }) where 19: test_code(desc, code, env = parent.frame(), reporter = reporter) where 20 at test-ecap.R#1: test_that("ecap model generation and prediction works", { p_obs <- runif(1000, 0, 1) p_new <- runif(1000, 0, 1) win_var <- rbinom(length(p_obs), 1, p_obs) ecap_fit <- try(ecap(unadjusted_prob = p_obs, win_var = win_var, win_id = 1, bias_indicator = FALSE)) ecap_fit_biased <- try(ecap(unadjusted_prob = p_obs, win_var = win_var, win_id = 1, bias_indicator = FALSE)) ecap_new <- try(predict(object = ecap_fit, new_unadjusted = p_new)) expect_equivalent(length(p_obs), 1000) expect_equivalent(class(ecap_fit), "ecap") expect_equivalent(class(ecap_fit_biased), "ecap") expect_equivalent(class(ecap_new), "numeric") }) where 21: eval(code, test_env) where 22: eval(code, test_env) where 23: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() } }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error) where 24: doTryCatch(return(expr), name, parentenv, handler) where 25: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 26: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) where 27: doTryCatch(return(expr), name, parentenv, handler) where 28: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]]) where 29: tryCatchList(expr, classes, parentenv, handlers) where 30: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() } }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { }) where 31: test_code(NULL, exprs, env) where 32: source_file(path, child_env(env), wrap = wrap) where 33: FUN(X[[i]], ...) where 34: lapply(test_paths, test_one_file, env = env, wrap = wrap) where 35: doTryCatch(return(expr), name, parentenv, handler) where 36: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 37: tryCatchList(expr, classes, parentenv, handlers) where 38: tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") NULL }) where 39: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, wrap = wrap)) where 40: test_files(test_dir = test_dir, test_package = test_package, test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap, load_package = load_package) where 41: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap, load_package = load_package, parallel = parallel) where 42: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed") where 43: test_check("ecap") --- value of length: 2 type: logical --- [1] TRUE FALSE --- function from context --- function (knots, x, ord = 4L, derivs = 0L, outer.ok = FALSE, sparse = FALSE) { if ((nk <- length(knots <- as.numeric(knots))) <= 0) stop("must have at least 'ord' knots") if (is.unsorted(knots)) knots <- sort.int(knots) x <- as.numeric(x) nx <- length(x) if (length(derivs) > nx) stop("length of 'derivs' is larger than length of 'x'") if (length(derivs) < 1L) stop("empty 'derivs'") ord <- as.integer(ord) if (ord > nk || ord < 1) stop("'ord' must be positive integer, at most the number of knots") if (!outer.ok && nk < 2 * ord - 1) stop(gettextf("need at least %s (=%d) knots", "2*ord -1", 2 * ord - 1), domain = NA) degree <- ord - 1L if (need.outer <- any(x < knots[ord] | knots[nk - degree] < x)) { if (outer.ok) { in.x <- knots[1L] <= x & x <= knots[nk] if ((x.out <- !all(in.x))) { x <- x[in.x] nnx <- length(x) } dkn <- diff(knots)[(nk - 1L):1] knots <- knots[c(rep.int(1L, degree), seq_len(nk), rep.int(nk, max(0L, ord - match(TRUE, dkn > 0))))] } else stop(gettextf("the 'x' data must be in the range %g to %g unless you set '%s'", knots[ord], knots[nk - degree], "outer.ok = TRUE"), domain = NA) } temp <- .Call(C_spline_basis, knots, ord, x, derivs) ncoef <- nk - ord ii <- if (need.outer && x.out) { rep.int((1L:nx)[in.x], rep.int(ord, nnx)) } else rep.int(1L:nx, rep.int(ord, nx)) jj <- c(outer(1L:ord, attr(temp, "Offsets"), `+`)) if (sparse) { if (is.null(tryCatch(loadNamespace("Matrix"), error = function(e) NULL))) stop(gettextf("%s needs package 'Matrix' correctly installed", "splineDesign(*, sparse=TRUE)"), domain = NA) if (need.outer) { jj <- jj - degree - 1L ok <- 0 <= jj & jj < ncoef methods::as(methods::new("dgTMatrix", i = ii[ok] - 1L, j = jj[ok], x = as.double(temp[ok]), Dim = c(nx, ncoef)), "CsparseMatrix") } else methods::as(methods::new("dgTMatrix", i = ii - 1L, j = jj - 1L, x = as.double(temp), Dim = c(nx, ncoef)), "CsparseMatrix") } else { design <- matrix(double(nx * ncoef), nx, ncoef) if (need.outer) { jj <- jj - degree ok <- 1 <= jj & jj <= ncoef design[cbind(ii, jj)[ok, , drop = FALSE]] <- temp[ok] } else design[cbind(ii, jj)] <- temp design } } --- function search by body --- Function splineDesign in namespace splines has this body. ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking re-building of vignette outputs ... [6s/22s] ERROR Error(s) in re-building vignettes: --- re-building ‘ecap-demo.Rmd’ using rmarkdown Loading required package: splines Loading required package: quadprog Loading required package: ggplot2 ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- splines --- call from context --- splineDesign(Aknots, rep(k.pivot, 2L), 4, c(0, 1), derivs = deriv) --- call from argument --- !outer.ok && nk < 2 * ord - 1 --- R stacktrace --- where 1: splineDesign(Aknots, rep(k.pivot, 2L), 4, c(0, 1), derivs = deriv) where 2: myns(fine_grid, knots = quantiles, intercept = T, Boundary.knots = knot.range) where 3: ecap(unadjusted_prob = p_obs_train, win_var = win_var_train, win_id = 1, bias_indicator = T) where 4: eval(expr, envir, enclos) where 5: eval(expr, envir, enclos) where 6: eval_with_user_handlers(expr, envir, enclos, user_handlers) where 7: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)) where 8: withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler) where 9: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)) where 10: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler))) where 11: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, debug = debug, last = i == length(out), use_try = stop_on_error != 2L, keep_warning = keep_warning, keep_message = keep_message, output_handler = output_handler, include_timing = include_timing) where 12: evaluate::evaluate(...) where 13: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options)) where 14: in_dir(input_dir(), expr) where 15: in_input_dir(evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options))) where 16: eng_r(options) where 17: block_exec(params) where 18: call_block(x) where 19: process_group.block(group) where 20: process_group(group) where 21: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), error = function(e) { setwd(wd) cat(res, sep = "\n", file = output %n% "") message("Quitting from lines ", paste(current_lines(i), collapse = "-"), " (", knit_concord$get("infile"), ") ") }) where 22: process_file(text, output) where 23: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet) where 24: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), output_dir = getwd(), ...) where 25: vweave_rmarkdown(...) where 26: engine$weave(file, quiet = quiet, encoding = enc) where 27: doTryCatch(return(expr), name, parentenv, handler) where 28: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 29: tryCatchList(expr, classes, parentenv, handlers) where 30: tryCatch({ engine$weave(file, quiet = quiet, encoding = enc) setwd(startdir) output <- find_vignette_product(name, by = "weave", engine = engine) if (!have.makefile && vignette_is_tex(output)) { texi2pdf(file = output, clean = FALSE, quiet = quiet) output <- find_vignette_product(name, by = "texi2pdf", engine = engine) } outputs <- c(outputs, output) }, error = function(e) { thisOK <<- FALSE fails <<- c(fails, file) message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s", file, conditionMessage(e))) }) where 31: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-LENGTH1/ecap.Rcheck/vign_test/ecap") --- value of length: 2 type: logical --- [1] TRUE FALSE --- function from context --- function (knots, x, ord = 4L, derivs = 0L, outer.ok = FALSE, sparse = FALSE) { if ((nk <- length(knots <- as.numeric(knots))) <= 0) stop("must have at least 'ord' knots") if (is.unsorted(knots)) knots <- sort.int(knots) x <- as.numeric(x) nx <- length(x) if (length(derivs) > nx) stop("length of 'derivs' is larger than length of 'x'") if (length(derivs) < 1L) stop("empty 'derivs'") ord <- as.integer(ord) if (ord > nk || ord < 1) stop("'ord' must be positive integer, at most the number of knots") if (!outer.ok && nk < 2 * ord - 1) stop(gettextf("need at least %s (=%d) knots", "2*ord -1", 2 * ord - 1), domain = NA) degree <- ord - 1L if (need.outer <- any(x < knots[ord] | knots[nk - degree] < x)) { if (outer.ok) { in.x <- knots[1L] <= x & x <= knots[nk] if ((x.out <- !all(in.x))) { x <- x[in.x] nnx <- length(x) } dkn <- diff(knots)[(nk - 1L):1] knots <- knots[c(rep.int(1L, degree), seq_len(nk), rep.int(nk, max(0L, ord - match(TRUE, dkn > 0))))] } else stop(gettextf("the 'x' data must be in the range %g to %g unless you set '%s'", knots[ord], knots[nk - degree], "outer.ok = TRUE"), domain = NA) } temp <- .Call(C_spline_basis, knots, ord, x, derivs) ncoef <- nk - ord ii <- if (need.outer && x.out) { rep.int((1L:nx)[in.x], rep.int(ord, nnx)) } else rep.int(1L:nx, rep.int(ord, nx)) jj <- c(outer(1L:ord, attr(temp, "Offsets"), `+`)) if (sparse) { if (is.null(tryCatch(loadNamespace("Matrix"), error = function(e) NULL))) stop(gettextf("%s needs package 'Matrix' correctly installed", "splineDesign(*, sparse=TRUE)"), domain = NA) if (need.outer) { jj <- jj - degree - 1L ok <- 0 <= jj & jj < ncoef methods::as(methods::new("dgTMatrix", i = ii[ok] - 1L, j = jj[ok], x = as.double(temp[ok]), Dim = c(nx, ncoef)), "CsparseMatrix") } else methods::as(methods::new("dgTMatrix", i = ii - 1L, j = jj - 1L, x = as.double(temp), Dim = c(nx, ncoef)), "CsparseMatrix") } else { design <- matrix(double(nx * ncoef), nx, ncoef) if (need.outer) { jj <- jj - degree ok <- 1 <= jj & jj <= ncoef design[cbind(ii, jj)[ok, , drop = FALSE]] <- temp[ok] } else design[cbind(ii, jj)] <- temp design } } --- function search by body --- Function splineDesign in namespace splines has this body. ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 2 ERRORs See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ecap.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 6:29.73, 77.01 + 10.81