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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: closedpCI
> ### Title: Customization of a Loglinear Model and Confidence Interval for
> ###   Abundance Estimation in Closed Population Capture-Recapture
> ###   Experiments
> ### Aliases: closedpCI closedpCI.t closedpCI.0 print.closedpCI plotCI
> ###   boxplot.closedpCI plot.closedpCI
> ### Keywords: models
> 
> ### ** Examples
> 
> data(hare)
> CI <- closedpCI.t(hare, m = "Mth", h = "Poisson", h.control = list(theta = 2))
> CI

Number of captured units: 68 

Poisson estimation and model fit:
             abundance stderr deviance df     AIC     BIC infoFit
Mth Poisson2      81.1    5.6   48.137 55 146.327 164.083      OK

Multinomial estimation, 95% profile likelihood confidence interval:
             abundance infCL supCL infoCI
Mth Poisson2      80.1  71.8  93.8     OK

> plotCI(CI)
> 
> data(HIV)
> mat <- histpos.t(4)
> mX2 <- cbind(mat, mat[, 1] * mat[ ,2])
> closedpCI.t(HIV, dfreq = TRUE, mX = mX2, mname = "Mt interaction 1,2")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
Rcapture
 --- call from context --- 
valid.mX(mX = mX, typet = typet, t = t, t0 = t0)
 --- call from argument --- 
if (class(mX) == "formula") {
    if (!typet) 
        stop("'mX' cannot be a formula for 'closedpCI.0'", call. = FALSE)
    if (length(mX) == 3) 
        stop("the formula given as 'mX' argument must not contain a response variable", 
            call. = FALSE)
    if (any(!(all.vars(mX) %in% c(".", paste("c", 1:t, sep = ""))))) 
        stop("the only accepted variable names in the formula given as 'mX' argument are ", 
            "c1 to c", t, ", which represent the capture occasions", 
            call. = FALSE)
} else if (is.character(mX)) {
    mX <- mX[1]
    if (substr(mX, 1, 1) != "[" || substr(mX, nchar(mX), nchar(mX)) != 
        "]") 
        stop("if 'mX' is a hierarchical model name, it must start with '[' and end with ']'")
    if (grepl(" ", mX, fixed = TRUE)) 
        stop("if 'mX' is a hierarchical model name, it must not contain white spaces")
    termes <- unlist(strsplit(substr(mX, 2, nchar(mX) - 1), ","))
    for (i in 1:length(termes)) {
        ielements <- unlist(strsplit(termes[i], ""))
        if (any(duplicated(ielements))) 
            stop("if 'mX' is a hierarchical model name, its terms must not contain duplicated characters")
        if (!all(ielements %in% 1:t)) 
            stop("if 'mX' is a hierarchical model name, its terms must be written with the characters ", 
                paste(1:(t - 1), collapse = ", "), " and ", t)
    }
    mX <- getFormulaFromName(mX)[[1]]
} else {
    if (!is.numeric(mX)) 
        stop("if 'mX' is not a formula or a hierarchical model name, it must be numeric", 
            call. = FALSE)
    testmX <- try(as.matrix(mX), silent = TRUE)
    if (class(testmX) == "try-error") {
        stop("cannot turn the given 'mX' argument into a matrix", 
            call. = FALSE)
    }
    else {
        mX <- testmX
    }
    nrows <- if (typet) 
        2^t - 1
    else t0
    if (nrow(mX) != nrows) 
        stop("'mX' must have ", ngettext(typet, "2^t-1", "t0"), 
            " rows", call. = FALSE)
    if (any(colSums(mX == 1) == nrow(mX))) 
        stop("'mX' must not contain a column of ones since an intercept is always added to the model", 
            call. = FALSE)
}
 --- R stacktrace ---
where 1: valid.mX(mX = mX, typet = typet, t = t, t0 = t0)
where 2: closedpCI.internal(X = X, dfreq = dfreq, m = m, mX = mX, h = h, 
    h.control = h.control, mname = mname, alpha = alpha, fmaxSupCL = fmaxSupCL, 
    call = call, ...)
where 3: closedpCI.t(HIV, dfreq = TRUE, mX = mX2, mname = "Mt interaction 1,2")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (mX, typet, t, t0) 
{
    if (!is.null(mX)) {
        if (class(mX) == "formula") {
            if (!typet) 
                stop("'mX' cannot be a formula for 'closedpCI.0'", 
                  call. = FALSE)
            if (length(mX) == 3) 
                stop("the formula given as 'mX' argument must not contain a response variable", 
                  call. = FALSE)
            if (any(!(all.vars(mX) %in% c(".", paste("c", 1:t, 
                sep = ""))))) 
                stop("the only accepted variable names in the formula given as 'mX' argument are ", 
                  "c1 to c", t, ", which represent the capture occasions", 
                  call. = FALSE)
        }
        else if (is.character(mX)) {
            mX <- mX[1]
            if (substr(mX, 1, 1) != "[" || substr(mX, nchar(mX), 
                nchar(mX)) != "]") 
                stop("if 'mX' is a hierarchical model name, it must start with '[' and end with ']'")
            if (grepl(" ", mX, fixed = TRUE)) 
                stop("if 'mX' is a hierarchical model name, it must not contain white spaces")
            termes <- unlist(strsplit(substr(mX, 2, nchar(mX) - 
                1), ","))
            for (i in 1:length(termes)) {
                ielements <- unlist(strsplit(termes[i], ""))
                if (any(duplicated(ielements))) 
                  stop("if 'mX' is a hierarchical model name, its terms must not contain duplicated characters")
                if (!all(ielements %in% 1:t)) 
                  stop("if 'mX' is a hierarchical model name, its terms must be written with the characters ", 
                    paste(1:(t - 1), collapse = ", "), " and ", 
                    t)
            }
            mX <- getFormulaFromName(mX)[[1]]
        }
        else {
            if (!is.numeric(mX)) 
                stop("if 'mX' is not a formula or a hierarchical model name, it must be numeric", 
                  call. = FALSE)
            testmX <- try(as.matrix(mX), silent = TRUE)
            if (class(testmX) == "try-error") {
                stop("cannot turn the given 'mX' argument into a matrix", 
                  call. = FALSE)
            }
            else {
                mX <- testmX
            }
            nrows <- if (typet) 
                2^t - 1
            else t0
            if (nrow(mX) != nrows) 
                stop("'mX' must have ", ngettext(typet, "2^t-1", 
                  "t0"), " rows", call. = FALSE)
            if (any(colSums(mX == 1) == nrow(mX))) 
                stop("'mX' must not contain a column of ones since an intercept is always added to the model", 
                  call. = FALSE)
        }
    }
    return(mX)
}
<bytecode: 0x562d426bb838>
<environment: namespace:Rcapture>
 --- function search by body ---
Function valid.mX in namespace Rcapture has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1