Running examples in 'echogram-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: add.echogram
> ### Title: Add two echograms
> ### Aliases: add.echogram
> ### Keywords: array
> 
> ### ** Examples
> 
> # import 38 and 120 kHz data from an HAC file 
> hacfile <- system.file("hac", "D20150510-T202500.hac", package = "echogram")
> echo2.038 <- read.echogram(hacfile, channel = 1)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
echogram
 --- call from context --- 
read.echogram(hacfile, channel = 1)
 --- call from argument --- 
if (class(Sv) != "matrix") Sv <- matrix(Sv, ncol = 1)
 --- R stacktrace ---
where 1: read.echogram(hacfile, channel = 1)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (hac, channel = NULL) 
{
    hacR <- readHAC::readHAC(hac)
    tuple.types <- unique(hacR$type)
    echosTupt <- c(100, 200, 210, 901)
    channelTupt <- c(1000, 1001, 2000, 2001, 2002, 2100, 9001)
    pingtupt <- c(10000, 10010, 10030, 10040, 10050)
    ett <- echosTupt[which(echosTupt %in% tuple.types)]
    ctt <- channelTupt[which(channelTupt %in% tuple.types)]
    ptt <- pingtupt[which(pingtupt %in% tuple.types)]
    if (missing(channel)) 
        channel <- min(hacR$softwarechannel, na.rm = TRUE)
    esTup <- hacR[hacR[["type"]] == ett]
    chanTup <- hacR[hacR[["type"]] == ctt & hacR[["softwarechannel"]] == 
        channel]
    pngTup <- hacR[hacR[["type"]] == ptt & hacR[["softwarechannel"]] == 
        channel]
    pTl <- unique(pngTup$length)
    nm <- length(pTl)
    if (nm < 3) {
        for (i in 1:nm) {
            pTup <- subset(pngTup, length == pTl[i])
            Sv <- readHAC::parseHAC(pTup)$"Sample value"
            Sv[Sv > 0] <- NA
            if (ptt == 10030) 
                Sv <- Sv * 10
            if (class(Sv) != "matrix") 
                Sv <- matrix(Sv, ncol = 1)
            assign(paste("Sv", i, sep = "."), Sv)
        }
        Sv <- get("Sv.1")
        if (nm > 1) 
            for (m in 2:nm) {
                Sv <- mergeSvmat(Sv, get(paste("Sv", m, sep = ".")))
            }
    }
    else {
        x <- split(pngTup, pngTup$pointer)
        y <- lapply(x, readHAC::parseHAC)
        z <- lapply(y, function(x) x$"Sample value")
        zz <- lapply(z, function(x) matrix(x, ncol = 1))
        Sv <- zz[[1]]
        for (g in 2:length(zz)) Sv <- mergeSvmat(Sv, zz[[g]])
    }
    frq <- readHAC::parseHAC(chanTup)$"Acoustic frequency"/1000
    attr(Sv, "frequency") <- paste(frq, "kHz")
    tsi <- readHAC::parseHAC(chanTup)$"Time sample interval"
    ss <- readHAC::parseHAC(esTup)$"Sound speed"
    dim1 <- dim(Sv)[1]
    if (is.null(tsi)) {
        sLen <- readHAC::parseHAC(chanTup)$"Sampling interval"
    }
    else sLen <- (ss * tsi)/2
    vLen <- c(sLen/2, rep(sLen, dim1 - 1))
    depth <- cumsum(vLen)
    bot <- bottom.hac(hacR, channel)
    pos <- position.hac(hacR)
    pos <- navigation.hac(pos)
    np <- nrow(bot)
    dbot <- data.frame(bot, speed = NA, cumdist = NA)
    if (nrow(pos) > 1) {
        for (k in 1:np) {
            p <- bot$pingTime[k]
            tdif <- abs(difftime(pos$time.cpu, p, units = "secs"))
            idx <- which.min(tdif)
            dbot[k, "speed"] <- pos$navspeed[idx]
        }
        tdif <- c(0, difftime(dbot[2:np, "pingTime"], dbot[1:(np - 
            1), "pingTime"], units = "hours"))
        dist <- dbot$speed * tdif
        dbot$cumdist <- cumsum(dist)
    }
    ans <- list(depth = depth, Sv = Sv, pings = dbot)
    class(ans) <- "echogram"
    ans
}
<bytecode: 0x16b2790>
<environment: namespace:echogram>
 --- function search by body ---
Function read.echogram in namespace echogram has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(Sv) != "matrix") Sv <- matrix(Sv, ncol = 1) : 
  the condition has length > 1
Calls: read.echogram
Execution halted