Error(s) in re-building vignettes:
  ...
--- re-building 'sport_in_r.Rmd' using rmarkdown
r is missing and will set to default=1500
rd is missing and will set to default=350
r is missing and will set to default=1500
rd is missing and will set to default=350
sigma is missing and will set to default=0.05
r is missing and will set to default=25
rd is missing and will set to default=8.33333333333333
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
sport
 --- call from context --- 
bbt_run(formula = rank | id ~ rider, data = gpheats)
 --- call from argument --- 
if (class(r) != "matrix") r <- as.matrix(r)
 --- R stacktrace ---
where 1: bbt_run(formula = rank | id ~ rider, data = gpheats)
where 2: eval(expr, envir, enclos)
where 3: eval(expr, envir, enclos)
where 4: withVisible(eval(expr, envir, enclos))
where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 8: 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 9: evaluate::evaluate(...)
where 10: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), 
    keep_message = !isFALSE(options$message), stop_on_error = if (options$error && 
        options$include) 0L else 2L, output_handler = knit_handlers(options$render, 
        options))
where 11: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE, 
    keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), 
    stop_on_error = if (options$error && options$include) 0L else 2L, 
    output_handler = knit_handlers(options$render, options)))
where 12: block_exec(params)
where 13: call_block(x)
where 14: process_group.block(group)
where 15: process_group(group)
where 16: 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 17: process_file(text, output)
where 18: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet, 
    encoding = encoding)
where 19: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 20: vweave_rmarkdown(...)
where 21: engine$weave(file, quiet = quiet, encoding = enc)
where 22: doTryCatch(return(expr), name, parentenv, handler)
where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 24: tryCatchList(expr, classes, parentenv, handlers)
where 25: 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 26: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/sport.Rcheck/vign_test/sport", 
    ser_elibs = "/tmp/RtmpFZ8HB2/file307d7c44cd14.rds")

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (formula, data, r, rd, sigma, weight, beta = 25/6, kappa = 0.5, 
    gamma, idlab, init_r = 25, init_rd = 25/3, pb = FALSE) 
{
    is_formula_missing(formula)
    is_data_provided(data)
    is_lhs_valid(formula)
    is_rhs_valid(formula, "bbt_run")
    lhs <- all.vars(update(formula, . ~ 0))
    rhs <- all.vars(update(formula, 0 ~ .))
    y <- lhs[1]
    x <- rhs[1]
    id <- ifelse(length(lhs) == 1, "id", lhs[2])
    if (length(lhs) == 1) 
        data$id <- 1
    if (missing(r)) {
        message(paste("r is missing and will set to default="), 
            init_r)
        names <- unique(data[[x]])
        r <- as.matrix(setNames(rep(init_r, length(names)), names))
    }
    if (missing(rd)) {
        message(paste("rd is missing and will set to default="), 
            init_rd)
        names <- unique(data[[x]])
        rd <- as.matrix(setNames(rep(init_rd, length(names)), 
            names))
    }
    if (missing(sigma)) {
        data$sigma <- 0
        sigma <- "sigma"
    }
    if (missing(weight)) {
        data$weight <- 1
        weight <- "weight"
    }
    if (missing(gamma)) 
        gamma <- 999
    if (missing(idlab)) 
        idlab <- id
    if (kappa == 0) 
        kappa = 1e-04
    if (class(r) != "matrix") 
        r <- as.matrix(r)
    if (class(rd) != "matrix") 
        rd <- as.matrix(rd)
    if (any(class(data) == "data.frame")) 
        data_list <- split(data[unique(c(y, id, x, sigma, weight, 
            idlab))], data[[id]])
    n <- length(data_list)
    if (pb) {
        j <- 0
        pb <- txtProgressBar(min = 0, max = n, width = 20, initial = 0, 
            style = 3)
    }
    models <- list()
    for (i in names(data_list)) {
        team_name <- data_list[[i]][[x]]
        model <- bbt(team_name, rank = data_list[[i]][[y]], r = r[team_name, 
            , drop = FALSE], rd = rd[team_name, , drop = FALSE], 
            sigma = data_list[[i]][[sigma]], weight = data_list[[i]][[weight]], 
            kappa = kappa, beta = beta, gamma = gamma, identifier = as.character(data_list[[i]][[idlab]]), 
            init_r = init_r, init_rd = init_rd)
        if (any(!is.finite(model$rd) | !is.finite(model$r) | 
            model$rd < 0)) 
            stop(paste0("Parameters error after evaluating ", 
                id, "=", i), call. = F)
        r[team_name, ] <- model$r[team_name, ]
        rd[team_name, ] <- model$rd[team_name, ]
        models[[i]] <- model
        if (pb) {
            j <- j + 1
            setTxtProgressBar(pb, j)
        }
    }
    model_r <- suppressWarnings(data.table::rbindlist(lapply(models, 
        function(x) x[["r_df"]]), use.names = T, idcol = "id"))
    model_P <- suppressWarnings(data.table::rbindlist(lapply(models, 
        function(x) x[["pairs"]]), use.names = T, idcol = "id"))
    identifierp <- unlist(lapply(models, `[[`, "identifierp"), 
        FALSE, FALSE)
    identifier <- unlist(lapply(models, `[[`, "identifier"), 
        FALSE, FALSE)
    class(model_r[[id]]) <- class(model_P[[id]]) <- class(data[[id]])
    p <- model_P[, .(p_win = prod(P)), by = c("id", "name")][, 
        `:=`(p_win, p_win/sum(p_win)), by = "id"]
    model_r <- merge(model_r, p, all.x = T, by = c("id", "name"), 
        sort = F)
    out <- structure(list(final_r = setNames(as.vector(r), rownames(r)), 
        final_rd = setNames(as.vector(rd), rownames(rd)), r = structure(model_r, 
            identifier = identifier), pairs = structure(model_P, 
            identifier = identifierp)), class = "rating", method = "bbt", 
        formula = formula, settings = list(sigma = sigma, weight = weight, 
            beta = beta, kappa = kappa, gamma = gamma, idlab = idlab, 
            init_r = init_r, init_rd = init_rd))
    return(out)
}
<bytecode: 0x6b99680>
<environment: namespace:sport>
 --- function search by body ---
Function bbt_run in namespace sport has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1