Running examples in ‘TDA-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: landscape
> ### Title: The Persistence Landscape Function
> ### Aliases: landscape
> ### Keywords: methods
> 
> ### ** Examples
> 
> Diag <- matrix(c(0, 0, 10, 1, 0, 3, 1, 3, 8), ncol = 3, byrow = TRUE)
> DiagLim <- 10
> colnames(Diag) <- c("dimension", "Birth", "Death")
> 
> #persistence landscape
> tseq <- seq(0,DiagLim, length = 1000)
> Land <- landscape(Diag, dimension = 1, KK = 1, tseq)
> 
> par(mfrow = c(1,2))
> plot.diagram(Diag)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
TDA
 --- call from context --- 
plot.diagram(Diag)
 --- call from argument --- 
if (class(x) == "diagram") {
    diagLim <- attributes(x)[["scale"]]
} else {
    nonInf <- which(x[, 2] != Inf & x[, 2] != -Inf & x[, 3] != 
        Inf & x[, 3] != -Inf)
    if (length(nonInf) > 0) {
        diagLim <- c(min(x[nonInf, 2:3]), max(x[nonInf, 2:3]))
    }
    else {
        diagLim <- c(0, 0)
    }
}
 --- R stacktrace ---
where 1: plot.diagram(Diag)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, diagLim = NULL, dimension = NULL, col = NULL, rotated = FALSE, 
    barcode = FALSE, band = NULL, lab.line = 2.2, colorBand = "pink", 
    colorBorder = NA, add = FALSE, ...) 
{
    if (((class(x) != "diagram" && class(x) != "matrix" && !is.data.frame(x)) || 
        NCOL(x) != 3) && (!is.numeric(x) || length(x) != 3)) {
        stop("x should be a diagram, or a P by 3 matrix")
    }
    if (!is.null(diagLim) && (!is.numeric(diagLim) || length(diagLim) != 
        2)) {
        stop("diagLim should be a vector of length 2")
    }
    if (!is.null(dimension) && (!is.numeric(dimension) || length(dimension) != 
        1 || any(dimension < 0))) {
        stop("dimension should be a nonnegative integer")
    }
    if (!is.logical(rotated)) {
        stop("rotated should be logical")
    }
    if (!is.logical(barcode)) {
        stop("barcode should be logical")
    }
    if (!is.null(band) && (!is.numeric(band) || length(band) != 
        1)) {
        stop("band should be a number")
    }
    if (!is.logical(add)) {
        stop("add should be logical")
    }
    if (class(x) != "diagram" && is.numeric(x)) {
        x <- matrix(x, ncol = 3, dimnames = list(NULL, colnames(x)))
    }
    if (is.null(diagLim) || any(diagLim == -Inf) || any(diagLim == 
        Inf)) {
        if (class(x) == "diagram") {
            diagLim <- attributes(x)[["scale"]]
        }
        else {
            nonInf <- which(x[, 2] != Inf & x[, 2] != -Inf & 
                x[, 3] != Inf & x[, 3] != -Inf)
            if (length(nonInf) > 0) {
                diagLim <- c(min(x[nonInf, 2:3]), max(x[nonInf, 
                  2:3]))
            }
            else {
                diagLim <- c(0, 0)
            }
        }
    }
    x[x[, 2] < diagLim[1], 2] <- diagLim[1]
    x[x[, 3] < diagLim[1], 3] <- diagLim[1]
    x[x[, 2] > diagLim[2], 2] <- diagLim[2]
    x[x[, 3] > diagLim[2], 3] <- diagLim[2]
    sublevel <- TRUE
    if (any(colnames(x)[3] == "Birth")) {
        sublevel <- FALSE
    }
    if (!is.null(dimension)) {
        x <- x[which(x[, 1] == dimension), , drop = FALSE]
    }
    if (is.null(match.call()[["pch"]])) {
        symb <- x[, 1]
        for (i in seq(along = symb)) {
            if (symb[i] == 0) {
                symb[i] <- 16
            }
            else if (symb[i] == 1) {
                symb[i] <- 2
            }
            else if (symb[i] == 2) {
                symb[i] <- 5
            }
            else if (symb[i] == 5) {
                symb[i] <- 1
            }
        }
    }
    else {
        symb <- match.call()[["pch"]]
    }
    if (is.null(col)) {
        col <- x[, 1] + 1
        for (i in seq(along = x[, 1])) {
            if (x[i, 1] == 2) {
                col[i] <- 4
            }
            if (x[i, 1] == 3) {
                col[i] <- 3
            }
        }
    }
    if (barcode) {
        if (length(col) == 1) {
            col <- rep(col, nrow(x))
        }
        maxD <- max(x[, 1])
        minD <- min(x[, 1])
        if (maxD > 0) {
            sortedDiag <- x
            sortedCol <- col
            posD <- which(x[, 1] == minD)
            lD <- 0
            for (dd in (minD):maxD) {
                oldlD <- lD
                posD <- which(x[, 1] == dd)
                if (length(posD) != 0) {
                  lD <- oldlD + length(posD)
                  sortedDiag[(oldlD + 1):(lD), ] <- x[posD, ]
                  sortedCol[(oldlD + 1):(lD)] <- col[posD]
                }
            }
            x <- sortedDiag
            col <- sortedCol
        }
        left <- x[, 2]
        right <- x[, 3]
        n <- length(left)
        Bmax <- max(right)
        Bmin <- min(left)
        graphics::plot(c(Bmin, Bmax), c(1, n + 1), type = "n", 
            xlab = "", ylab = "", xlim = c(Bmin, Bmax), ylim = c(0, 
                n + 1), xaxt = "n", yaxt = "n", ...)
        graphics::axis(1)
        graphics::title(xlab = "time", line = lab.line)
        lwid <- rep(2, n)
        ltype <- rep(1, n)
        if (!is.null(band)) {
            for (i in seq_len(n)) {
                if ((x[i, 3] - x[i, 2]) <= band) {
                  ltype[i] <- 3
                  lwid[i] <- 1.5
                }
            }
        }
        graphics::segments(left, 1:n, right, 1:n, lwd = lwid, 
            lty = ltype, col = col)
    }
    else {
        if (rotated == TRUE) {
            if (add == FALSE) {
                graphics::plot(0, 0, type = "n", axes = FALSE, 
                  xlim = diagLim, ylim = diagLim, xlab = " ", 
                  ylab = " ", ...)
            }
            if (!is.null(band)) {
                graphics::polygon(c(0, diagLim[2] + 1, diagLim[2] + 
                  1, 0), c(0, 0, band, band), col = colorBand, 
                  lwd = 1.5, border = colorBorder)
            }
            graphics::points((x[, 2] + x[, 3])/2, (x[, 3] - x[, 
                2])/2, col = col, pch = symb, lwd = 2, cex = 1)
        }
        else {
            if (add == FALSE) {
                graphics::plot(0, 0, type = "n", axes = FALSE, 
                  xlim = diagLim, ylim = diagLim, xlab = " ", 
                  ylab = " ", ...)
            }
            if (!is.null(band)) {
                graphics::polygon(c(diagLim[1] - 1, diagLim[2] + 
                  1, diagLim[2] + 1, diagLim[1] - 1), c(diagLim[1] - 
                  1, diagLim[2] + 1, diagLim[2] + 1 + band, diagLim[1] - 
                  1 + band), col = colorBand, lwd = 1.5, border = colorBorder)
            }
            graphics::points(x[, 2], x[, 3], pch = symb, lwd = 2, 
                cex = 1, col = col)
            graphics::abline(0, 1)
        }
        if (add == FALSE) {
            graphics::axis(1)
            graphics::axis(2)
            if (sublevel) {
                if (!rotated) {
                  graphics::title(main = "", xlab = "Birth", 
                    ylab = "Death", line = lab.line)
                }
                else {
                  graphics::title(main = "", ylab = "(Death-Birth)/2", 
                    xlab = "(Death+Birth)/2", line = lab.line)
                }
            }
            if (!sublevel) {
                if (!rotated) {
                  graphics::title(main = "", xlab = "Death", 
                    ylab = "Birth", line = lab.line)
                }
                else {
                  graphics::title(main = "", ylab = "(Birth-Death)/2", 
                    xlab = "(Death+Birth)/2", line = lab.line)
                }
            }
        }
    }
}
<bytecode: 0x55a8f5ff76a0>
<environment: namespace:TDA>
 --- function search by body ---
Function plot.diagram in namespace TDA has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1