CRAN Package Check Results for Package l0ara

Last updated on 2019-12-14 00:54:08 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.1.5 33.40 25.68 59.08 ERROR
r-devel-linux-x86_64-debian-gcc 0.1.5 23.08 20.16 43.24 OK
r-devel-linux-x86_64-fedora-clang 0.1.5 80.37 OK
r-devel-linux-x86_64-fedora-gcc 0.1.5 78.09 OK
r-devel-windows-ix86+x86_64 0.1.5 69.00 76.00 145.00 OK
r-devel-windows-ix86+x86_64-gcc8 0.1.5 65.00 96.00 161.00 OK
r-patched-linux-x86_64 0.1.5 27.63 23.71 51.34 OK
r-patched-solaris-x86 0.1.5 84.50 OK
r-release-linux-x86_64 0.1.5 25.74 24.09 49.83 OK
r-release-windows-ix86+x86_64 0.1.5 71.00 49.00 120.00 OK
r-release-osx-x86_64 0.1.5 OK
r-oldrel-windows-ix86+x86_64 0.1.5 47.00 51.00 98.00 OK
r-oldrel-osx-x86_64 0.1.5 OK

Check Details

Version: 0.1.5
Check: examples
Result: ERROR
    Running examples in 'l0ara-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: cv.l0ara
    > ### Title: cross-validation for l0ara
    > ### Aliases: cv.l0ara
    >
    > ### ** Examples
    >
    > #' # Linear regression
    > # Generate design matrix and response variable
    > n <- 100
    > p <- 40
    > x <- matrix(rnorm(n*p), n, p)
    > beta <- c(1,0,2,3,rep(0,p-4))
    > noise <- rnorm(n)
    > y <- x%*%beta+noise
    > lam <- c(0.1, 0.3, 0.5)
    > fit <- cv.l0ara(x, y, family="gaussian", lam, measure = "mse")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    l0ara
     --- call from context ---
    cv.l0ara(x, y, family = "gaussian", lam, measure = "mse")
     --- call from argument ---
    if (class(x) != "matrix") {
     tmp <- try(x <- model.matrix(~0 + ., data = x), silent = TRUE)
     if (class(tmp)[1] == "try-error")
     stop("x must be a matrix or able to be coerced to a matrix")
    }
     --- R stacktrace ---
    where 1: cv.l0ara(x, y, family = "gaussian", lam, measure = "mse")
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (x, y, family = c("gaussian", "logit", "gamma", "poisson",
     "inv.gaussian"), lam, measure = c("mse", "mae", "class",
     "auc"), nfolds = 10, maxit = 10^3, eps = 1e-04, seed)
    {
     measure <- match.arg(measure)
     if (class(x) != "matrix") {
     tmp <- try(x <- model.matrix(~0 + ., data = x), silent = TRUE)
     if (class(tmp)[1] == "try-error")
     stop("x must be a matrix or able to be coerced to a matrix")
     }
     if (class(y) != "numeric") {
     tmp <- try(y <- as.numeric(y), silent = TRUE)
     if (class(tmp)[1] == "try-error")
     stop("y must numeric or able to be coerced to numeric")
     }
     y <- drop(y)
     if (!is.null(lam) && length(lam) < 2) {
     stop("Need a sequence values for lambda")
     }
     if (nfolds < 3) {
     stop("nfolds must be bigger than 3")
     }
     if (!missing(seed)) {
     set.seed(seed)
     }
     n <- nrow(x)
     p <- ncol(x)
     res <- as.list(1:nfolds)
     error <- matrix(NA, length(lam), nfolds)
     id <- sample(rep(1:nfolds, length = n))
     for (i in 1:nfolds) {
     which <- id == i
     yy <- y[!which]
     xx <- x[!which, , drop = FALSE]
     res[[i]] <- lapply(lam, function(ll) l0ara(xx, yy, lam = ll,
     family = family, maxit = maxit, eps = eps))
     if (measure == "mse") {
     pred <- lapply(res[[i]], predict, x[which, ], type = "response")
     error[, i] <- do.call(cbind, lapply(pred, function(pp) mean((pp -
     y[which])^2)))
     }
     if (measure == "mae") {
     pred <- lapply(res[[i]], predict, x[which, ], type = "response")
     error[, i] <- do.call(cbind, lapply(pred, function(pp) mean(abs(pp -
     y[which]))))
     }
     if (measure == "class") {
     if (family == "logit") {
     pred <- lapply(res[[i]], predict, x[which, ],
     type = "class")
     error[, i] <- do.call(cbind, lapply(pred, function(pp) mean((y[which] -
     pp) != 0)))
     }
     else {
     stop("type='class' can only be used with family='logit'")
     }
     }
     if (measure == "auc") {
     if (family == "logit") {
     pred <- lapply(res[[i]], predict, x[which, ],
     type = "class")
     error[, i] <- do.call(cbind, lapply(pred, function(pp) {
     fp <- mean(pp[y[which] == 0] == 1)
     tp <- mean(pp[y[which] == 1] == 1)
     return((tp - fp + 1)/2)
     }))
     }
     else {
     stop("type='auc' can only be used with family='logit'")
     }
     }
     }
     cv.std <- apply(error, 1, sd)/sqrt(n)
     cv.error <- rowMeans(error)
     lam.min <- ifelse(measure == "auc", lam[which.max(cv.error)],
     lam[which.min(cv.error)])
     name <- switch(measure, mse = "Mean square error", mae = "Mean absolute error",
     class = "Misclassification rate", auc = "Area under the curve")
     out <- list(cv.error = cv.error, cv.std = cv.std, lam.min = lam.min,
     measure = measure, lambda = lam, family = family, x = x,
     y = y, name = name)
     class(out) <- "cv.l0ara"
     return(out)
    }
    <bytecode: 0x334f4d0>
    <environment: namespace:l0ara>
     --- function search by body ---
    Function cv.l0ara in namespace l0ara has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(x) != "matrix") { : the condition has length > 1
    Calls: cv.l0ara
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang