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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: classDist
> ### Title: Compute and predict the distances to class centroids
> ### Aliases: classDist classDist.default predict.classDist
> ### Keywords: manip
> 
> ### ** Examples
> 
> trainSet <- sample(1:150, 100)
> 
> distData <- classDist(iris[trainSet, 1:4],
+                       iris$Species[trainSet])
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
caret
 --- call from context --- 
FUN(X[[i]], ...)
 --- call from argument --- 
if (class(A) == "try-error") stop("Cannot compute the covariance matrix")
 --- R stacktrace ---
where 1: FUN(X[[i]], ...)
where 2: lapply(x, getStats)
where 3: structure(list(values = lapply(x, getStats), classes = classLabels, 
    cuts = cuts, pca = pca, call = match.call(), p = p, n = unlist(lapply(x, 
        nrow))), class = "classDist")
where 4: classDist.default(iris[trainSet, 1:4], iris$Species[trainSet])
where 5: classDist(iris[trainSet, 1:4], iris$Species[trainSet])

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (u) 
{
    if (nrow(u) < ncol(u)) 
        stop("there must be more rows than columns for this class")
    A <- try(cov(u), silent = TRUE)
    if (class(A) == "try-error") 
        stop("Cannot compute the covariance matrix")
    A <- try(solve(A), silent = TRUE)
    if (class(A) == "try-error") 
        stop("Cannot invert the covariance matrix")
    list(means = colMeans(u, na.rm = TRUE), A = A)
}
<bytecode: 0x120f0390>
<environment: 0x120f2c08>
 --- function search by body ---
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(A) == "try-error") stop("Cannot compute the covariance matrix") : 
  the condition has length > 1
Calls: classDist -> classDist.default -> structure -> lapply -> FUN
Execution halted