* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/penalizedclr.Rcheck’ * using R Under development (unstable) (2022-04-03 r82074) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘penalizedclr/DESCRIPTION’ ... OK * this is package ‘penalizedclr’ version ‘0.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 ‘penalizedclr’ can be installed ... [11s/37s] 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 ... NOTE Namespace in Imports field not imported from: ‘tidyverse’ All declared Imports should be used. * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [14s/19s] 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 installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... ERROR Running examples in ‘penalizedclr-Ex.R’ failed The error most likely occurred in: > ### Name: penalized.clr > ### Title: Penalized conditional logistic regression > ### Aliases: penalized.clr > > ### ** Examples > > set.seed(123) > # simulate covariates (pure noise in two blocks of 20 and 80 variables) > X <- cbind(matrix(rnorm(4000, 0, 1), ncol = 20), matrix(rnorm(16000, 2, 0.6), ncol = 80)) > > # stratum membership > stratum <- sort(rep(1:100, 2)) > > # the response > Y <- rep(c(1, 0), 100) > > fit <- penalized.clr( response = Y, stratum = stratum, + penalized = X, lambda = c(1, 0.3), + p = c(20, 80), standardize = TRUE) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- penalized --- call from context --- penalized::penalized(Y ~ strata(stratum), penalized = penalized, lambda1 = lambda1, lambda2 = lambda2, standardize = standardize) --- call from argument --- lambda1 == 0 && lambda2 == 0 --- R stacktrace --- where 1: penalized::penalized(Y ~ strata(stratum), penalized = penalized, lambda1 = lambda1, lambda2 = lambda2, standardize = standardize) where 2: penalized.clr(response = Y, stratum = stratum, penalized = X, lambda = c(1, 0.3), p = c(20, 80), standardize = TRUE) --- value of length: 100 type: logical --- [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [97] FALSE FALSE FALSE FALSE --- function from context --- function (response, penalized, unpenalized, lambda1 = 0, lambda2 = 0, positive = FALSE, data, fusedl = FALSE, model = c("cox", "logistic", "linear", "poisson"), startbeta, startgamma, steps = 1, epsilon = 1e-10, maxiter, standardize = FALSE, trace = TRUE) { if (missing(maxiter)) maxiter <- if (lambda1 == 0 && lambda2 == 0 && !positive) 25 else Inf if (steps == "Park" || steps == "park") { steps <- 1 park <- TRUE } else park <- FALSE prep <- .checkinput(match.call(), parent.frame()) if (ncol(prep$X) >= nrow(prep$X) && all(lambda1 == 0) && all(lambda2 == 0) && !any(prep$positive)) stop("High-dimensional data require a penalized model. Please supply lambda1 or lambda2.", call. = FALSE) fit <- .modelswitch(prep$model, prep$response, prep$offset, prep$strata)$fit pu <- length(prep$nullgamma) pp <- ncol(prep$X) - pu n <- nrow(prep$X) nr <- nrow(prep$X) fusedl <- prep$fusedl if (length(lambda1) == pp && (!all(lambda1 == 0))) { wl1 <- c(numeric(pu), lambda1) lambda1 <- 1 } else { wl1 <- 1 } if (length(lambda2) == pp) lambda2 <- c(numeric(pu), lambda2) if (park || steps > 1 && fusedl == FALSE) { if (pu > 0) lp <- drop(prep$X[, 1:pu, drop = FALSE] %*% prep$nullgamma) else lp <- numeric(n) chck <- (wl1 > 0) & c(rep(FALSE, pu), rep(TRUE, pp)) gradient <- drop(crossprod(prep$X[, chck, drop = FALSE], fit(lp)$residuals)) if (length(wl1) > 1) { rel <- gradient/(wl1[chck] * prep$baselambda1[chck]) } else { rel <- gradient/(wl1 * prep$baselambda1[chck]) } from <- max(ifelse(prep$positive[chck], rel, abs(rel))) if (from < lambda1) { warning("Chosen lambda1 greater than maximal lambda1: \"steps\" argument ignored") steps <- 1 park <- FALSE from <- lambda1 } } else { from <- lambda1 } lambda1s <- seq(from, lambda1, length.out = steps) beta <- prep$beta louts <- if (park) 4 * pp else length(lambda1s) outs <- vector("list", louts) rellambda1 <- lambda1s[1] ready <- FALSE i <- 0 while (!ready) { ready <- (rellambda1 == lambda1) i <- i + 1 if (!fusedl) { if (rellambda1 != 0 || any(prep$positive)) { if (all(lambda2 == 0)) { out <- .steplasso(beta = beta, lambda = rellambda1 * wl1 * prep$baselambda1, lambda2 = 0, positive = prep$positive, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } else { out <- .lasso(beta = beta, lambda = rellambda1 * wl1 * prep$baselambda1, lambda2 = lambda2 * prep$baselambda2, positive = prep$positive, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } } else { if (pp > n) { P <- .makeP(prep$X, lambda2 * prep$baselambda2) gams <- .solve(crossprod(t(P)), P %*% beta) PX <- P %*% t(prep$X) Pl <- P * matrix(sqrt(lambda2 * prep$baselambda2), nrow(P), ncol(P), byrow = TRUE) PlP <- crossprod(t(Pl)) out <- .ridge(beta = gams, Lambda = PlP, X = t(PX), fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) out$beta <- drop(crossprod(P, out$beta)) } else { out <- .ridge(beta = beta, Lambda = lambda2 * prep$baselambda2, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } } } if (fusedl) { out <- .flasso(beta = beta, lambda1 = rellambda1 * wl1 * prep$baselambda1, lambda2 = lambda2 * prep$baselambda2, chr = prep$chr, positive = prep$positive, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } if (trace) cat("\n") beta <- out$beta if (!ready) { if (!fusedl) { if (park) { newpark <- .park(beta = beta, lambda = rellambda1 * wl1 * prep$baselambda1, lambda2 = 0, positive = prep$positive, X = prep$X, fit = out$fit) rellambda1 <- rellambda1 * (1 - newpark$hh) if (rellambda1 < lambda1 || rellambda1 == Inf) { rellambda1 <- lambda1 beta <- out$beta } else { beta <- newpark$beta } lambda1s <- c(lambda1s, rellambda1) } else { rellambda1 <- lambda1s[i + 1] beta <- out$beta } } else { rellambda1 <- lambda1s[i + 1] beta <- out$beta } } outs[[i]] <- out } if (length(lambda2) > 1) lambda2 <- lambda2[pu + 1:pp] outs <- sapply(1:i, function(nr) { thislambda1 <- lambda1s[[nr]] * ifelse(length(wl1) > 1, wl1[pu + 1:pp], wl1) .makepenfit(outs[[nr]], pu, fusedl = fusedl, prep$model, thislambda1, lambda2, prep$orthogonalizer, prep$weights, prep$formula, rownames(prep$X)) }) if (length(outs) == 1) outs <- outs[[1]] outs } --- function search by body --- Function penalized in namespace penalized 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 ... [12s/14s] ERROR Error(s) in re-building vignettes: --- re-building ‘penalizedclr.Rmd’ using rmarkdown Loading required package: tidyverse ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ── ✔ ggplot2 3.3.5 ✔ purrr 0.3.4 ✔ tibble 3.1.6 ✔ dplyr 1.0.8 ✔ tidyr 1.2.0 ✔ stringr 1.4.0 ✔ readr 2.1.2 ✔ forcats 0.5.1 ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ── ✖ dplyr::filter() masks stats::filter() ✖ dplyr::lag() masks stats::lag() ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- penalized --- call from context --- penalized::penalized(Y ~ strata(stratum), penalized = penalized, lambda1 = lambda1, lambda2 = lambda2, standardize = standardize) --- call from argument --- lambda1 == 0 && lambda2 == 0 --- R stacktrace --- where 1: penalized::penalized(Y ~ strata(stratum), penalized = penalized, lambda1 = lambda1, lambda2 = lambda2, standardize = standardize) where 2: penalized.clr(response = Y, penalized = X, stratum = stratum, lambda = c(6, 7), p = p, standardize = TRUE) where 3: eval(expr, envir, enclos) where 4: eval(expr, envir, enclos) where 5: eval_with_user_handlers(expr, envir, enclos, user_handlers) where 6: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)) where 7: withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler) where 8: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)) where 9: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler))) where 10: 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 11: evaluate::evaluate(...) where 12: 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 13: in_dir(input_dir(), expr) where 14: 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 15: eng_r(options) where 16: block_exec(params) where 17: call_block(x) where 18: process_group.block(group) where 19: process_group(group) where 20: 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 21: process_file(text, output) where 22: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet) where 23: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), output_dir = getwd(), ...) where 24: vweave_rmarkdown(...) where 25: engine$weave(file, quiet = quiet, encoding = enc) where 26: doTryCatch(return(expr), name, parentenv, handler) where 27: tryCatchOne(expr, names, parentenv, handlers[[1L]]) where 28: tryCatchList(expr, classes, parentenv, handlers) where 29: 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 30: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-LENGTH1/penalizedclr.Rcheck/vign_test/penalizedclr") --- value of length: 100 type: logical --- [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [97] FALSE FALSE FALSE FALSE --- function from context --- function (response, penalized, unpenalized, lambda1 = 0, lambda2 = 0, positive = FALSE, data, fusedl = FALSE, model = c("cox", "logistic", "linear", "poisson"), startbeta, startgamma, steps = 1, epsilon = 1e-10, maxiter, standardize = FALSE, trace = TRUE) { if (missing(maxiter)) maxiter <- if (lambda1 == 0 && lambda2 == 0 && !positive) 25 else Inf if (steps == "Park" || steps == "park") { steps <- 1 park <- TRUE } else park <- FALSE prep <- .checkinput(match.call(), parent.frame()) if (ncol(prep$X) >= nrow(prep$X) && all(lambda1 == 0) && all(lambda2 == 0) && !any(prep$positive)) stop("High-dimensional data require a penalized model. Please supply lambda1 or lambda2.", call. = FALSE) fit <- .modelswitch(prep$model, prep$response, prep$offset, prep$strata)$fit pu <- length(prep$nullgamma) pp <- ncol(prep$X) - pu n <- nrow(prep$X) nr <- nrow(prep$X) fusedl <- prep$fusedl if (length(lambda1) == pp && (!all(lambda1 == 0))) { wl1 <- c(numeric(pu), lambda1) lambda1 <- 1 } else { wl1 <- 1 } if (length(lambda2) == pp) lambda2 <- c(numeric(pu), lambda2) if (park || steps > 1 && fusedl == FALSE) { if (pu > 0) lp <- drop(prep$X[, 1:pu, drop = FALSE] %*% prep$nullgamma) else lp <- numeric(n) chck <- (wl1 > 0) & c(rep(FALSE, pu), rep(TRUE, pp)) gradient <- drop(crossprod(prep$X[, chck, drop = FALSE], fit(lp)$residuals)) if (length(wl1) > 1) { rel <- gradient/(wl1[chck] * prep$baselambda1[chck]) } else { rel <- gradient/(wl1 * prep$baselambda1[chck]) } from <- max(ifelse(prep$positive[chck], rel, abs(rel))) if (from < lambda1) { warning("Chosen lambda1 greater than maximal lambda1: \"steps\" argument ignored") steps <- 1 park <- FALSE from <- lambda1 } } else { from <- lambda1 } lambda1s <- seq(from, lambda1, length.out = steps) beta <- prep$beta louts <- if (park) 4 * pp else length(lambda1s) outs <- vector("list", louts) rellambda1 <- lambda1s[1] ready <- FALSE i <- 0 while (!ready) { ready <- (rellambda1 == lambda1) i <- i + 1 if (!fusedl) { if (rellambda1 != 0 || any(prep$positive)) { if (all(lambda2 == 0)) { out <- .steplasso(beta = beta, lambda = rellambda1 * wl1 * prep$baselambda1, lambda2 = 0, positive = prep$positive, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } else { out <- .lasso(beta = beta, lambda = rellambda1 * wl1 * prep$baselambda1, lambda2 = lambda2 * prep$baselambda2, positive = prep$positive, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } } else { if (pp > n) { P <- .makeP(prep$X, lambda2 * prep$baselambda2) gams <- .solve(crossprod(t(P)), P %*% beta) PX <- P %*% t(prep$X) Pl <- P * matrix(sqrt(lambda2 * prep$baselambda2), nrow(P), ncol(P), byrow = TRUE) PlP <- crossprod(t(Pl)) out <- .ridge(beta = gams, Lambda = PlP, X = t(PX), fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) out$beta <- drop(crossprod(P, out$beta)) } else { out <- .ridge(beta = beta, Lambda = lambda2 * prep$baselambda2, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } } } if (fusedl) { out <- .flasso(beta = beta, lambda1 = rellambda1 * wl1 * prep$baselambda1, lambda2 = lambda2 * prep$baselambda2, chr = prep$chr, positive = prep$positive, X = prep$X, fit = fit, trace = trace, epsilon = epsilon, maxiter = maxiter) } if (trace) cat("\n") beta <- out$beta if (!ready) { if (!fusedl) { if (park) { newpark <- .park(beta = beta, lambda = rellambda1 * wl1 * prep$baselambda1, lambda2 = 0, positive = prep$positive, X = prep$X, fit = out$fit) rellambda1 <- rellambda1 * (1 - newpark$hh) if (rellambda1 < lambda1 || rellambda1 == Inf) { rellambda1 <- lambda1 beta <- out$beta } else { beta <- newpark$beta } lambda1s <- c(lambda1s, rellambda1) } else { rellambda1 <- lambda1s[i + 1] beta <- out$beta } } else { rellambda1 <- lambda1s[i + 1] beta <- out$beta } } outs[[i]] <- out } if (length(lambda2) > 1) lambda2 <- lambda2[pu + 1:pp] outs <- sapply(1:i, function(nr) { thislambda1 <- lambda1s[[nr]] * ifelse(length(wl1) > 1, wl1[pu + 1:pp], wl1) .makepenfit(outs[[nr]], pu, fusedl = fusedl, prep$model, thislambda1, lambda2, prep$orthogonalizer, prep$weights, prep$formula, rownames(prep$X)) }) if (length(outs) == 1) outs <- outs[[1]] outs } --- function search by body --- Function penalized in namespace penalized 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, 1 NOTE See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/penalizedclr.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 3:21.70, 90.57 + 11.00