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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: genBetaMPT
> ### Title: Generate Data for Beta MPT Models
> ### Aliases: genBetaMPT
> 
> ### ** Examples
> 
> # Example: Standard Two-High-Threshold Model (2HTM)
> EQNfile <- system.file("MPTmodels/2htm.eqn", package="TreeBUGS")
> genDat <- genBetaMPT(N = 100,
+                      numItems = c(Target=250, Lure=250),
+                      eqnfile = EQNfile,
+                      mean = c(Do=.7, Dn=.5, g=.5),
+                      sd =   c(Do=.1, Dn=.1, g=.05))
> head(genDat$data, 3)
      CR FA Hit Miss
[1,] 211 39 230   20
[2,] 194 56 217   33
[3,] 178 72 225   25
> plotFreq(genDat$data, eqn=EQNfile)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
TreeBUGS
 --- call from context --- 
plotFreq(genDat$data, eqn = EQNfile)
 --- call from argument --- 
if (class(x) %in% c("betaMPT", "traitMPT")) {
    dat <- x$mptInfo$data
} else if (class(x) == "character") {
    dat <- read.csv(x)
} else {
    try(dat <- as.data.frame(x))
}
 --- R stacktrace ---
where 1: plotFreq(genDat$data, eqn = EQNfile)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, freq = TRUE, select = "all", boxplot = TRUE, eqnfile, 
    ...) 
{
    if (class(x) %in% c("betaMPT", "traitMPT")) {
        dat <- x$mptInfo$data
    }
    else if (class(x) == "character") {
        dat <- read.csv(x)
    }
    else {
        try(dat <- as.data.frame(x))
    }
    if (class(x) %in% c("betaMPT", "traitMPT")) {
        treeNames <- x$mptInfo$MPT$Tree
        treeLabels <- unique(treeNames)
    }
    else if (!missing(eqnfile)) {
        tmp <- unique(readEQN(eqnfile)[, 1:2])
        treeNames <- tmp$Tree
        treeLabels <- unique(treeNames)
        try(dat <- dat[, colnames(dat) %in% tmp$Category])
    }
    else {
        treeNames <- rep("", ncol(dat))
        treeLabels <- ""
    }
    K <- ncol(dat)
    N <- nrow(dat)
    if (select == "all") {
        select <- 1:N
    }
    else {
        if (!is.numeric(select) || any(select != round(select))) 
            stop("Please use an integer vector to select participants.")
        dat <- dat[select, , drop = FALSE]
        N <- nrow(dat)
    }
    if (!freq) {
        for (t in 1:length(treeLabels)) {
            sel <- treeNames == treeLabels[t]
            dat[, sel] <- dat[, sel]/rep(rowSums(dat[, sel]), 
                each = sum(sel))
        }
    }
    means <- colMeans(dat)
    if (boxplot == TRUE) {
        boxplot(dat, ylab = ifelse(freq, "Absolute frequency", 
            "Relative frequency (per tree)"), xlab = "", main = ifelse(freq, 
            "Absolute frequency", "Relative frequency (per tree)"), 
            las = 1, ...)
        lines(1:K, means, col = "red", lwd = 2)
    }
    else {
        plot(1:K, rep(NA, K), ylim = c(0, max(dat)), col = 1, 
            lwd = 3, pch = 16, xaxt = "n", las = 1, ..., ylab = ifelse(freq, 
                "Absolute frequency", "Relative frequency (per tree)"), 
            xlab = "", main = ifelse(freq, "Absolute frequency", 
                "Relative frequency (per tree)"))
        axis(1, 1:K, colnames(dat))
        for (treelab in treeLabels) {
            sel <- treeNames == treelab
            for (i in 1:N) {
                lines((1:K)[sel], dat[i, sel], col = rainbow(N, 
                  alpha = 0.4)[i])
                points((1:K)[sel], dat[i, sel], col = rainbow(N, 
                  alpha = 0.6)[i], pch = 16)
            }
            lines((1:K)[sel], means[sel], col = 1, lwd = 3)
        }
    }
    xt <- 0.5
    for (k in 2:K) {
        if (treeNames[k] != treeNames[k - 1]) {
            abline(v = k - 0.5)
            xt <- c(xt, k - 0.5)
        }
    }
    xt <- c(xt, K + 0.5)
    axis(1, xt[1:(length(xt) - 1)] + diff(xt)/2, treeLabels, 
        mgp = c(100, 3, 10))
}
<bytecode: 0x563ce0315498>
<environment: namespace:TreeBUGS>
 --- function search by body ---
Function plotFreq in namespace TreeBUGS has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1