Error(s) in re-building vignettes:
  ...
--- re-building ‘countgmifs.rnw’ using Sweave
Loading required package: MASS
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
countgmifs
 --- call from context --- 
countgmifs(y ~ 1, data = data, offset = NULL, x = x, epsilon = 0.01, 
    tol = 0.001, scale = TRUE, verbose = FALSE)
 --- call from argument --- 
if (class(x) == "character") {
    nl <- as.list(1:ncol(data))
    names(nl) <- names(data)
    vars <- eval(substitute(x), nl, parent.frame())
    x <- data[r, vars, drop = FALSE]
    x <- as.matrix(x)
} else if (class(x) == "matrix" || class(x) == "data.frame") {
    x <- x[r, , drop = FALSE]
    x <- as.matrix(x)
}
 --- R stacktrace ---
where 1: countgmifs(y ~ 1, data = data, offset = NULL, x = x, epsilon = 0.01, 
    tol = 0.001, scale = TRUE, verbose = FALSE)
where 2: eval(expr, .GlobalEnv)
where 3: eval(expr, .GlobalEnv)
where 4: withVisible(eval(expr, .GlobalEnv))
where 5: doTryCatch(return(expr), name, parentenv, handler)
where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 7: tryCatchList(expr, classes, parentenv, handlers)
where 8: 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)[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 9: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
where 10: evalFunc(ce, options)
where 11: tryCatchList(expr, classes, parentenv, handlers)
where 12: tryCatch(evalFunc(ce, options), finally = {
    cat("\n")
    sink()
})
where 13: driver$runcode(drobj, chunk, chunkopts)
where 14: utils::Sweave(...)
where 15: engine$weave(file, quiet = quiet, encoding = enc)
where 16: doTryCatch(return(expr), name, parentenv, handler)
where 17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 18: tryCatchList(expr, classes, parentenv, handlers)
where 19: 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 20: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/countgmifs.Rcheck/vign_test/countgmifs", 
    ser_elibs = "/home/hornik/tmp/scratch/RtmpN2Srcg/file5c8a1d0fe0c7.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (formula, data, x = NULL, offset, subset, epsilon = 0.001, 
    tol = 1e-05, scale = TRUE, verbose = FALSE, family = "nb", 
    ...) 
{
    mf <- match.call(expand.dots = FALSE)
    cl <- match.call()
    m <- match(c("formula", "data", "subset", "offset"), names(mf), 
        0L)
    mf <- mf[c(1L, m)]
    mf[[1L]] <- as.name("model.frame")
    mf <- eval(mf, parent.frame())
    mt <- attr(mf, "terms")
    y <- model.response(mf)
    w <- model.matrix(mt, mf)
    offset <- model.offset(mf)
    if (!is.null(x)) {
        if (missing(subset)) 
            r <- TRUE
        else {
            e <- substitute(subset)
            r <- eval(e, data)
            if (!is.logical(r)) 
                stop("'subset' must evaluate to logical")
            r <- r & !is.na(r)
        }
        if (class(x) == "character") {
            nl <- as.list(1:ncol(data))
            names(nl) <- names(data)
            vars <- eval(substitute(x), nl, parent.frame())
            x <- data[r, vars, drop = FALSE]
            x <- as.matrix(x)
        }
        else if (class(x) == "matrix" || class(x) == "data.frame") {
            x <- x[r, , drop = FALSE]
            x <- as.matrix(x)
        }
    }
    if (is.na(match(family, c("poisson", "nb")))) {
        stop("Error:")
        cat("Only poisson and nb are available for family.\n")
    }
    if (!is.null(offset)) {
        offset <- log(offset)
    }
    data <- data.matrix(data)
    n <- length(y)
    if (!is.null(x)) {
        vars <- dim(x)[2]
        oldx <- x
        if (scale) {
            x <- scale(x, center = TRUE, scale = TRUE)
        }
        x_original <- x
        x <- cbind(x, -1 * x)
        beta <- rep(0, dim(x)[2])
        names(beta) <- dimnames(x)[[2]]
        step <- 1
        Estimates <- matrix(0, ncol = vars)
        if (family == "nb") {
            if (!is.null(offset)) {
                initialize <- glm.nb(y ~ w - 1 + offset(offset), 
                  control = glm.control(maxit = 100))
            }
            else {
                initialize <- glm.nb(y ~ w - 1, control = glm.control(maxit = 100))
            }
            a <- 1/theta.mm(initialize)
            a.update <- a
        }
        else {
            if (!is.null(offset)) {
                initialize <- glm(y ~ w - 1, offset = offset, 
                  family = poisson)
            }
            else {
                initialize <- glm(y ~ w - 1, family = poisson)
            }
        }
        LL0 <- Likelihood <- logLik(initialize)
        AIC <- AIC(initialize)
        BIC <- BIC(initialize)
        theta <- coef(initialize)
        theta.update <- matrix(theta, ncol = length(theta))
        repeat {
            step <- 1 + step
            if (!is.null(offset)) {
                Xb <- cbind(offset, w, x) %*% c(1, theta, beta)
            }
            else {
                Xb <- cbind(w, x) %*% c(theta, beta)
            }
            if (family == "nb") {
                u <- t(x) %*% ((y - exp(Xb))/(1 + (a * exp(Xb))))
            }
            else {
                u <- t(x) %*% (y - exp(Xb))
            }
            update.j <- which.min(-u)
            if (-u[update.j] < 0) {
                beta[update.j] <- beta[update.j] + epsilon
            }
            Estimates <- rbind(Estimates, beta[1:vars] - beta[(vars + 
                1):length(beta)])
            if (family == "nb") {
                out <- optim(theta, nb.theta, a = a, w = w, x = x_original, 
                  y = y, offset = offset, beta = beta[1:vars] - 
                    beta[(vars + 1):length(beta)], method = "BFGS")
                theta <- out$par
                a <- hilbe(w = w, y = y, x = x_original, theta = theta, 
                  beta = beta[1:vars] - beta[(vars + 1):length(beta)], 
                  offset = offset, delta = 1e-05)
                a.update <- c(a.update, a)
                p <- sum(Estimates[step, ] != 0) + length(theta) + 
                  1
                Likelihood[step] <- LL1 <- -out$value
                AIC[step] <- 2 * p - 2 * Likelihood[step]
                BIC[step] <- p * log(n) - 2 * Likelihood[step]
            }
            else {
                out <- optim(theta, poisson.theta, w = w, x = x, 
                  y = y, offset = offset, beta = beta, method = "BFGS")
                theta <- out$par
                p <- sum(Estimates[step + 1, ] != 0) + length(theta)
                Likelihood[step] <- LL1 <- -out$value
                AIC[step] <- 2 * p - 2 * Likelihood[step]
                BIC[step] <- p * log(n) - 2 * Likelihood[step]
            }
            theta.update <- rbind(theta.update, theta)
            if (verbose) 
                cat("step = ", step, "\n")
            if (step >= 1 && ((abs(LL1 - LL0) < tol) || (p >= 
                n - 1))) {
                break
            }
            LL0 <- LL1
        }
        if (family == "nb") {
            output <- list(a = a.update, beta = Estimates, theta = theta.update, 
                x = oldx, y = y, scale = scale, logLik = Likelihood, 
                AIC = AIC, BIC = BIC, w = w, offset = offset, 
                family = family)
        }
        else {
            output <- list(beta = Estimates, theta = theta.update, 
                x = oldx, y = y, scale = scale, logLik = Likelihood, 
                AIC = AIC, BIC = BIC, w = w, offset = offset, 
                family = family)
        }
        class(output) <- "countgmifs"
    }
    else {
        if (family == "nb") {
            out <- glm.nb(y ~ w - 1, offset = offset)
            output <- list(coef(out), a = 1/out$theta)
        }
        else {
            output <- glm(y ~ w - 1, offset = offset, family = poisson)
        }
    }
    output
}
<bytecode: 0x55c286c67220>
<environment: namespace:countgmifs>
 --- function search by body ---
Function countgmifs in namespace countgmifs has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1