* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/SCPME.Rcheck’ * using R Under development (unstable) (2022-04-26 r82260) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘SCPME/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘SCPME’ version ‘1.0’ * 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 ‘SCPME’ can be installed ... [124s/271s] 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 ... [14s/34s] 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 LazyData ... NOTE 'LazyData' is specified without a 'data' directory * checking line endings in C/C++/Fortran sources/headers ... OK * checking line endings in Makefiles ... OK * checking compilation flags in Makevars ... OK * checking for GNU extensions in Makefiles ... OK * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking use of PKG_*FLAGS in Makefiles ... OK * checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK * checking pragmas in C/C++ headers and code ... OK * checking compilation flags used ... OK * checking compiled code ... 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’ [6s/16s] [6s/17s] ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(SCPME) Loading required package: Rcpp Loading required package: RcppProgress Loading required package: doParallel Loading required package: foreach Loading required package: iterators Loading required package: parallel > > test_check("SCPME") ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- SCPME --- call from context --- shrink(data$X, data$Y, path = TRUE, trace = "none") --- call from argument --- !path || (crit.cv == "MSE") --- R stacktrace --- where 1: shrink(data$X, data$Y, path = TRUE, trace = "none") where 2: eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) where 3: withCallingHandlers({ code NULL }, error = function(cnd) { if (can_entrace(cnd)) { cnd <- cnd_entrace(cnd) } return_from(env, cnd) }) where 4: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), ...) where 5: quasi_capture(enquo(object), label, capture_error, entrace = TRUE) where 6 at testSCPME.R#30: expect_error(shrink(data$X, data$Y, path = TRUE, trace = "none"), NA) where 7: eval(code, test_env) where 8: eval(code, test_env) where 9: 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 10: doTryCatch(return(expr), name, parentenv, handler) where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) where 13: doTryCatch(return(expr), name, parentenv, handler) where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]]) where 15: tryCatchList(expr, classes, parentenv, handlers) where 16: 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 17: test_code(NULL, exprs, env) where 18: source_file(path, child_env(env), wrap = wrap) where 19: FUN(X[[i]], ...) where 20: lapply(test_paths, test_one_file, env = env, wrap = wrap) where 21: doTryCatch(return(expr), name, parentenv, handler) where 22: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 23: tryCatchList(expr, classes, parentenv, handlers) where 24: tryCatch(code, testthat_abort_reporter = function(cnd) { cat(conditionMessage(cnd), "\n") NULL }) where 25: with_reporter(reporters$multi, lapply(test_paths, test_one_file, env = env, wrap = wrap)) where 26: 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 27: 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 28: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed") where 29: test_check("SCPME") --- value of length: 5 type: logical --- [1] TRUE FALSE FALSE FALSE FALSE --- function from context --- function (X = NULL, Y = NULL, S = NULL, A = diag(ncol(S)), B = diag(ncol(S)), C = matrix(0, ncol = ncol(B), nrow = ncol(A)), nlam = 10, lam.max = NULL, lam.min.ratio = 0.001, lam = NULL, alpha = 1, path = FALSE, rho = 2, mu = 10, tau.rho = 2, iter.rho = 10, crit = c("ADMM", "loglik"), tol.abs = 1e-04, tol.rel = 1e-04, maxit = 10000, adjmaxit = NULL, K = 5, crit.cv = c("MSE", "loglik", "penloglik", "AIC", "BIC"), start = c("warm", "cold"), cores = 1, trace = c("progress", "print", "none")) { if (is.null(X) && is.null(S)) { stop("Must provide entry for X or S!") } if (!all(lam > 0)) { stop("lam must be positive!") } if (!(all(c(rho, mu, tau.rho, iter.rho, tol.abs, tol.rel, maxit, adjmaxit, K, cores) > 0))) { stop("Entry must be positive!") } if ((alpha < 0) || (alpha > 1)) { stop("Alpha must be between 0 and 1!") } if (!(all(sapply(c(rho, mu, tau.rho, iter.rho, tol.abs, tol.rel, maxit, adjmaxit, K, cores, nlam, lam.min.ratio, alpha), length) <= 1))) { stop("Entry must be single value!") } if (all(c(maxit, adjmaxit, K, cores)%%1 != 0)) { stop("Entry must be an integer!") } if (cores < 1) { stop("Number of cores must be positive!") } if (((length(lam) > 1) & (!path || (crit.cv == "MSE"))) & (is.null(X) || is.null(Y))) { stop("Must provide entry for X and Y!") } if (is.null(Y) && (crit.cv == "MSE")) { cat("Matrix Y not detected... will use loglik for crit.cv instead!\n\n") crit.cv = "loglik" } if (cores > 1 && path) { cat("Parallelization not possible when producing solution path. Setting cores = 1...\n\n") cores = 1 } if (path) { if (match.arg(crit.cv) == "MSE") { cat("MSE crit.cv not available when path == TRUE... setting crit.cv == loglik\n\n") crit.cv = "loglik" } K = 1 } if (cores > K) { cat("Number of cores exceeds K... setting cores = K\n\n") cores = K } if (is.null(adjmaxit)) { adjmaxit = maxit } crit = match.arg(crit) crit.cv = match.arg(crit.cv) start = match.arg(start) trace = match.arg(trace) call = match.call() MIN.error = AVG.error = CV.error = NULL n = ifelse(is.null(X), nrow(S), nrow(X)) if (is.null(Y)) { Y = matrix(0) } if (is.null(S)) { S = (nrow(X) - 1)/nrow(X) * cov(X) if (nrow(A) == 0) { A = diag(ncol(S)) } if (nrow(B) == 0) { B = diag(ncol(S)) } if (nrow(C) == 0) { C = matrix(0, ncol = ncol(B), nrow = ncol(A)) } } tau = max(eigen(crossprod(A))$values) * max(eigen(tcrossprod(B))$values) + 1e-08 if (ncol(A) != ncol(S)) { stop("Matrix A has incompatible number of columns!") } if (nrow(B) != ncol(S)) { stop("Matrix B has incompatible number of rows!") } if ((nrow(C) != nrow(A)) || (ncol(C) != ncol(B))) { stop("Matrix C has incompatible dimensions!") } if (is.null(lam)) { if (!((lam.min.ratio <= 1) && (lam.min.ratio > 0))) { cat("lam.min.ratio must be in (0, 1]... setting to 1e-2!\n\n") lam.min.ratio = 0.01 } if (!((nlam > 0) && (nlam%%1 == 0))) { cat("nlam must be a positive integer... setting to 10!\n\n") nlam = 10 } if (is.null(lam.max)) { lam.max = max(abs(S - diag(S))) } lam.min = lam.min.ratio * lam.max lam = 10^seq(log10(lam.min), log10(lam.max), length = nlam) } else { lam = sort(lam) } initOmega = diag(diag(S)^(-1)) init = A %*% initOmega %*% B - C zeros = matrix(0, nrow = nrow(C), ncol = ncol(C)) if ((length(lam) > 1) && (!is.null(X) || path)) { if (cores > 1) { ADMM = CVP_ADMM(X = X, Y = Y, A = A, B = B, C = C, lam = lam, alpha = alpha, tau = tau, rho = rho, mu = mu, tau.rho = tau.rho, iter.rho = iter.rho, crit = crit, tol.abs = tol.abs, tol.rel = tol.rel, maxit = maxit, adjmaxit = adjmaxit, K = K, crit.cv = crit.cv, start = start, cores = cores, trace = trace) MIN.error = ADMM$min.error AVG.error = ADMM$avg.error CV.error = ADMM$cv.error } else { if (is.null(X)) { X = matrix(0) } ADMM = CV_ADMMc(X = X, S = S, Y = Y, A = A, B = B, C = C, lam = lam, alpha = alpha, path = path, tau = tau, rho = rho, mu = mu, tau_rho = tau.rho, iter_rho = iter.rho, crit = crit, tol_abs = tol.abs, tol_rel = tol.rel, maxit = maxit, adjmaxit = adjmaxit, K = K, crit_cv = crit.cv, start = start, trace = trace) MIN.error = ADMM$min.error AVG.error = ADMM$avg.error CV.error = ADMM$cv.error Path = ADMM$path } if (((ADMM$lam == lam[1]) || ADMM$lam == lam[length(lam)]) && ((length(lam) != 1) && (!path))) { cat("\nOptimal tuning parameter on boundary...!\n") } ADMM = ADMMc(S = S, A = A, B = B, C = C, initOmega = initOmega, initZ = init, initY = zeros, lam = ADMM$lam, alpha = alpha, tau = tau, rho = rho, mu = mu, tau_rho = tau.rho, iter_rho = iter.rho, crit = crit, tol_abs = tol.abs, tol_rel = tol.rel, maxit = maxit) } else { if (length(lam) > 1) { stop("Must set specify X, set path = TRUE, or provide single value for lam.") } ADMM = ADMMc(S = S, A = A, B = B, C = C, initOmega = initOmega, initZ = init, initY = zeros, lam = lam, alpha = alpha, tau = tau, rho = rho, mu = mu, tau_rho = tau.rho, iter_rho = iter.rho, crit = crit, tol_abs = tol.abs, tol_rel = tol.rel, maxit = maxit) } loglik = (-n/2) * (sum(ADMM$Omega * S) - determinant(ADMM$Omega, logarithm = TRUE)$modulus[1] + ADMM$lam * ((1 - alpha)/2 * sum((A %*% ADMM$Omega %*% B - C)^2) + alpha * sum(abs(A %*% ADMM$Omega %*% B - C)))) tuning = matrix(c(log10(ADMM$lam), ADMM$lam), ncol = 2) colnames(tuning) = c("log10(lam)", "lam") if (!path) { Path = NULL } returns = list(Call = call, Iterations = ADMM$Iterations, Tuning = tuning, Lambdas = lam, maxit = maxit, Omega = ADMM$Omega, Sigma = qr.solve(ADMM$Omega), Path = Path, Z = ADMM$Z, Y = ADMM$Y, rho = ADMM$rho, Loglik = loglik, MIN.error = MIN.error, AVG.error = AVG.error, CV.error = CV.error) class(returns) = "shrink" return(returns) } --- function search by body --- Function shrink in namespace SCPME 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 ... [22s/58s] OK * 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: 1 ERROR, 1 NOTE See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/SCPME.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 8:58.67, 206.77 + 20.05