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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: ests
> ### Title: Inference for Accuracy Measures based on Bootstrap
> ### Aliases: ests
> ### Keywords: CCR
> 
> ### ** Examples
> 
> str(iris)
'data.frame':	150 obs. of  5 variables:
 $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
 $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
 $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
 $ Petal.Width : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
 $ Species     : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
> data <- iris[, 1:4]
> label <- iris[, 5]
> ests(y = label, d = data,acc="hum",level=0.95,method = "multinom",B=10,trace=FALSE)
$value
[1] 0.9972

$se
[1] 0.002795649

$interval
[1] 0.9909984 1.0000000

> 
> ## $value
> ## [1] 0.9972
> 
> ## $se
> ## [1] 0.002051529
> 
> ## $interval
> ## [1] 0.9935662 1.0000000
> 
> ests(y = label, d = data,acc="pdi",level=0.85,method = "tree",B=10)
$value
[1] 0.9213333

$se
[1] 0.01984263

$interval
[1] 0.9120078 0.9607843

> 
> ## $value
> ## [1] 0.9213333
> 
> ## $se
> ## [1] 0.02148812
> 
> ## $interval
> ## [1] 0.9019608 0.9629630
> 
> table(mtcars$carb)

 1  2  3  4  6  8 
 7 10  3 10  1  1 
> for (i in (1:length(mtcars$carb))) {
+   if (mtcars$carb[i] == 3 | mtcars$carb[i] == 6 | mtcars$carb[i] == 8) {
+     mtcars$carb_new[i] = 9
+   }else{
+     mtcars$carb_new[i] = mtcars$carb[i]
+   }
+ }
> data <- data.matrix(mtcars[, c(1:2)])
> mtcars$carb_new <- factor(mtcars$carb_new)
> label <- mtcars$carb_new
> str(mtcars)
'data.frame':	32 obs. of  12 variables:
 $ mpg     : num  21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ...
 $ cyl     : num  6 6 4 6 8 6 8 4 4 6 ...
 $ disp    : num  160 160 108 258 360 ...
 $ hp      : num  110 110 93 110 175 105 245 62 95 123 ...
 $ drat    : num  3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ...
 $ wt      : num  2.62 2.88 2.32 3.21 3.44 ...
 $ qsec    : num  16.5 17 18.6 19.4 17 ...
 $ vs      : num  0 0 1 1 0 1 0 1 1 1 ...
 $ am      : num  1 1 1 0 0 0 0 0 0 0 ...
 $ gear    : num  4 4 4 3 3 3 3 4 4 4 ...
 $ carb    : num  4 4 1 1 2 1 4 2 2 4 ...
 $ carb_new: Factor w/ 4 levels "1","2","4","9": 3 3 1 1 2 1 3 2 2 3 ...
> 
> ests(y = label, d = data,acc="hum",level=0.95,method = "multinom",trace=FALSE,B=5)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
mcca
 --- call from context --- 
ests(y = label, d = data, acc = "hum", level = 0.95, method = "multinom", 
    trace = FALSE, B = 5)
 --- call from argument --- 
if (class(d) == "numeric") {
    series[b] <- hum(y = y[id], d = d[id], method = method, ...)$measure
} else {
    series[b] <- hum(y = y[id], d = d[id, ], method = method, 
        ...)$measure
}
 --- R stacktrace ---
where 1: ests(y = label, d = data, acc = "hum", level = 0.95, method = "multinom", 
    trace = FALSE, B = 5)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (y, d, acc = "hum", level = 0.95, method = "multinom", 
    B = 250, balance = FALSE, ...) 
{
    series = numeric()
    k = length(unique(y))
    if (acc == "hum") {
        if (balance == FALSE) {
            for (b in 1:B) {
                nn <- length(y)
                id <- sample(1:nn, nn, replace = T)
                while (length(unique(y[id])) < k) {
                  id <- sample(1:nn, nn, replace = T)
                }
                while (min(table(y[id])) < 2) {
                  id <- sample(1:nn, nn, replace = T)
                }
                if (class(d) == "numeric") {
                  series[b] <- hum(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- hum(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        if (balance == TRUE) {
            for (b in 1:B) {
                id <- unlist(caret::createResample(y, times = 1))
                if (class(d) == "numeric") {
                  series[b] <- hum(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- hum(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        series.sort <- sort(series)
        return(list(value = hum(y = y, d = d, method = method, 
            ...)$measure, se = sd(series), interval = c(series.sort[ifelse(B * 
            (0.5 - level/2) < 1, 1, B * (0.5 - level/2))], series.sort[B * 
            (0.5 + level/2)])))
    }
    if (acc == "pdi") {
        if (balance == FALSE) {
            for (b in 1:B) {
                nn <- length(y)
                id <- sample(1:nn, nn, replace = T)
                while (length(unique(y[id])) < k) {
                  id <- sample(1:nn, nn, replace = T)
                }
                while (min(table(y[id])) < 2) {
                  id <- sample(1:nn, nn, replace = T)
                }
                if (class(d) == "numeric") {
                  series[b] <- pdi(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- pdi(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        if (balance == TRUE) {
            for (b in 1:B) {
                id <- unlist(caret::createResample(y, times = 1))
                if (class(d) == "numeric") {
                  series[b] <- pdi(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- pdi(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        series.sort <- sort(series)
        return(list(value = pdi(y = y, d = d, method = method, 
            ...)$measure, se = sd(series), interval = c(series.sort[ifelse(B * 
            (0.5 - level/2) < 1, 1, B * (0.5 - level/2))], series.sort[B * 
            (0.5 + level/2)])))
    }
    if (acc == "ccp") {
        if (balance == FALSE) {
            for (b in 1:B) {
                nn <- length(y)
                id <- sample(1:nn, nn, replace = T)
                while (length(unique(y[id])) < k) {
                  id <- sample(1:nn, nn, replace = T)
                }
                while (min(table(y[id])) < 2) {
                  id <- sample(1:nn, nn, replace = T)
                }
                if (class(d) == "numeric") {
                  series[b] <- ccp(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- ccp(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        if (balance == TRUE) {
            for (b in 1:B) {
                id <- unlist(caret::createResample(y, times = 1))
                if (class(d) == "numeric") {
                  series[b] <- ccp(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- ccp(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        series.sort <- sort(series)
        return(list(value = ccp(y = y, d = d, method = method, 
            ...)$measure, se = sd(series), interval = c(series.sort[ifelse(B * 
            (0.5 - level/2) < 1, 1, B * (0.5 - level/2))], series.sort[B * 
            (0.5 + level/2)])))
    }
    if (acc == "rsq") {
        if (balance == FALSE) {
            for (b in 1:B) {
                nn <- length(y)
                id <- sample(1:nn, nn, replace = T)
                while (length(unique(y[id])) < k) {
                  id <- sample(1:nn, nn, replace = T)
                }
                while (min(table(y[id])) < 2) {
                  id <- sample(1:nn, nn, replace = T)
                }
                if (class(d) == "numeric") {
                  series[b] <- rsq(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- rsq(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        if (balance == TRUE) {
            for (b in 1:B) {
                id <- unlist(caret::createResample(y, times = 1))
                if (class(d) == "numeric") {
                  series[b] <- rsq(y = y[id], d = d[id], method = method, 
                    ...)$measure
                }
                else {
                  series[b] <- rsq(y = y[id], d = d[id, ], method = method, 
                    ...)$measure
                }
            }
        }
        series.sort <- sort(series)
        return(list(value = rsq(y = y, d = d, method = method, 
            ...)$measure, se = sd(series), interval = c(series.sort[ifelse(B * 
            (0.5 - level/2) < 1, 1, B * (0.5 - level/2))], series.sort[B * 
            (0.5 + level/2)])))
    }
}
<bytecode: 0x8d2b6a8>
<environment: namespace:mcca>
 --- function search by body ---
Function ests in namespace mcca has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1