Error(s) in re-building vignettes:
  ...
--- re-building ‘Ternary.Rmd’ using rmarkdown
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
Ternary
 --- call from context --- 
TernaryDensity(coordinates, resolution = 10L)
 --- call from argument --- 
if (class(coordinates) == "list") {
    scaled <- resolution * vapply(coordinates, function(coord) coord/sum(coord), 
        double(3L))
} else {
    scaled <- resolution * apply(coordinates, 1, function(coord) coord/sum(coord))
}
 --- R stacktrace ---
where 1: TernaryDensity(coordinates, resolution = 10L)
where 2: ColourTernary(TernaryDensity(coordinates, resolution = 10L))
where 3: eval(expr, envir, enclos)
where 4: eval(expr, envir, enclos)
where 5: withVisible(eval(expr, envir, enclos))
where 6: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 7: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 8: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 9: 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 10: evaluate::evaluate(...)
where 11: 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: 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 13: block_exec(params)
where 14: call_block(x)
where 15: process_group.block(group)
where 16: process_group(group)
where 17: 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 18: process_file(text, output)
where 19: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet, 
    encoding = encoding)
where 20: rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
    ...)
where 21: vweave_rmarkdown(...)
where 22: engine$weave(file, quiet = quiet, encoding = enc)
where 23: doTryCatch(return(expr), name, parentenv, handler)
where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 25: tryCatchList(expr, classes, parentenv, handlers)
where 26: 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 27: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/Ternary.Rcheck/vign_test/Ternary", 
    ser_elibs = "/home/hornik/tmp/scratch/RtmprtZUQx/file2ae638ba21e2.rds")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (coordinates, resolution = 48L, direction = getOption("ternDirection")) 
{
    if (class(coordinates) == "list") {
        scaled <- resolution * vapply(coordinates, function(coord) coord/sum(coord), 
            double(3L))
    }
    else {
        scaled <- resolution * apply(coordinates, 1, function(coord) coord/sum(coord))
    }
    whichTri <- floor(scaled)
    margins <- scaled%%1 == 0
    onVertex <- apply(margins, 2, all)
    onEdge <- logical(length(onVertex))
    onEdge[!onVertex] <- apply(margins[, !onVertex], 2, any)
    centres <- whichTri[, !onEdge & !onVertex, drop = FALSE]
    edges <- scaled[, onEdge, drop = FALSE]
    floorEdges <- floor(edges)
    vertices <- scaled[, onVertex, drop = FALSE]
    vertexLocation <- apply(vertices == 0, 2, sum)
    vertexInternal <- vertexLocation == 0L
    vertexOnEdge <- vertexLocation == 1L
    vertexOnCorner <- vertexLocation == 2L
    AllEqual <- function(x, y) all(x == y)
    OnUpEdge <- function(abc) {
        onThisEdge <- apply(floorEdges, 2, AllEqual, abc)
        theseEdges <- edges[, onThisEdge, drop = FALSE]
        ncol(theseEdges) + {
            if (abc[1] == 0) 
                sum(theseEdges[1, ] == 0)
            else 0L
        } + {
            if (abc[2] == 0) 
                sum(theseEdges[2, ] == 0)
            else 0L
        } + {
            if (abc[3] == 0) 
                sum(theseEdges[3, ] == 0)
            else 0L
        }
    }
    OnDownEdge <- function(abc) {
        sum(apply(edges, 2, AllEqual, abc + c(0.5, 0.5, 1)), 
            apply(edges, 2, AllEqual, abc + c(0.5, 1, 0.5)), 
            apply(edges, 2, AllEqual, abc + c(1, 0.5, 0.5)))
    }
    OnUpVertex <- function(abc) {
        onThisTriangle <- apply(vertices, 2, AllEqual, abc + 
            c(1L, 0L, 0L)) | apply(vertices, 2, AllEqual, abc + 
            c(0L, 1L, 0L)) | apply(vertices, 2, AllEqual, abc + 
            c(0L, 0L, 1L))
        sum(vertexInternal[onThisTriangle], 2L * vertexOnEdge[onThisTriangle], 
            6L * vertexOnCorner[onThisTriangle])
    }
    OnDownVertex <- function(abc) {
        onThisTriangle <- apply(vertices, 2, AllEqual, abc + 
            c(1L, 1L, 0L)) | apply(vertices, 2, AllEqual, abc + 
            c(1L, 0L, 1L)) | apply(vertices, 2, AllEqual, abc + 
            c(0L, 1L, 1L))
        sum(vertexInternal[onThisTriangle], 2L * vertexOnEdge[onThisTriangle])
    }
    ups <- unlist(lapply(seq_len(resolution) - 1L, function(a) {
        vapply(seq_len(resolution - a) - 1L, function(b) {
            abc <- c(a, b, resolution - a - b - 1L)
            (6 * sum(apply(centres, 2, AllEqual, abc))) + (3 * 
                sum(OnUpEdge(abc))) + sum(OnUpVertex(abc))
        }, double(1), USE.NAMES = FALSE)
    }))
    downs <- unlist(lapply(seq_len(resolution - 1L) - 1L, function(a) {
        vapply(seq_len(resolution - a - 1L) - 1L, function(b) {
            abc <- c(a, b, resolution - a - b - 2L)
            6 * sum(apply(centres, 2, AllEqual, abc)) + (3 * 
                sum(OnDownEdge(abc))) + sum(OnDownVertex(abc))
        }, double(1), USE.NAMES = FALSE)
    }))
    centrePoints <- TriangleCentres(resolution, direction)
    triDown <- as.logical(centrePoints["triDown", ])
    ret <- integer(length(ups) + length(downs))
    towardsBase <- if (direction < 3L) 
        triDown
    else !triDown
    ret[towardsBase] <- downs
    ret[!towardsBase] <- ups
    switch(direction, {
        xy <- centrePoints[1:2, ]
    }, {
        xy <- rbind(x = centrePoints[1, ], y = -centrePoints[2, 
            ])
    }, {
        xy <- rbind(x = -centrePoints[1, ], y = centrePoints[2, 
            ])
    }, {
        xy <- centrePoints[1:2, ]
    })
    rbind(xy, z = ret, down = triDown)
}
<bytecode: 0x56280a22c998>
<environment: namespace:Ternary>
 --- function search by body ---
Function TernaryDensity in namespace Ternary has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1