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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: MorphMatrix2PCoA
> ### Title: Principal Coordinates on a Cladistic Matrix
> ### Aliases: MorphMatrix2PCoA
> ### Keywords: classic coordinates multidimensional principal scaling,
> 
> ### ** Examples
> 
> 
> # Run on Michaux (189) data set with defaults:
> x <- MorphMatrix2PCoA(Michaux1989)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
Claddis
 --- call from context --- 
TrimMorphDistMatrix(morph_distances$DistanceMatrix)
 --- call from argument --- 
if (class(dist.matrix) == "dist") dist.matrix <- as.matrix(dist.matrix)
 --- R stacktrace ---
where 1: TrimMorphDistMatrix(morph_distances$DistanceMatrix)
where 2: MorphMatrix2PCoA(Michaux1989)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (dist.matrix, Tree = NULL) 
{
    if (class(dist.matrix) == "dist") 
        dist.matrix <- as.matrix(dist.matrix)
    if (!is.matrix(dist.matrix)) 
        stop("ERROR: Input must be a distance matrix (i.e., either an object of class \"dist\" or a square matrix).")
    if (is.null(Tree)) {
        if (length(which(is.na(dist.matrix))) == 0) {
            print("There are no gaps in the distance matrix")
            removed.taxa <- NULL
            out <- list(dist.matrix, Tree, removed.taxa)
            names(out) <- c("DistMatrix", "Tree", "RemovedTaxa")
            return(out)
        }
        else {
            removes <- vector(mode = "character")
            while (length(which(is.na(dist.matrix))) > 0) {
                na.lengths <- vector(mode = "numeric")
                for (i in 1:length(dist.matrix[, 1])) na.lengths[i] <- length(which(is.na(dist.matrix[i, 
                  ])))
                taxon.to.delete <- rownames(dist.matrix)[which(na.lengths == 
                  max(na.lengths))[1]]
                delete.row <- which(rownames(dist.matrix) == 
                  taxon.to.delete)
                dist.matrix <- dist.matrix[-delete.row, -delete.row]
                removes <- c(removes, taxon.to.delete)
            }
            out <- list(dist.matrix, Tree, removes)
            names(out) <- c("DistMatrix", "Tree", "RemovedTaxa")
            return(out)
        }
    }
    else {
        if (length(which(is.na(dist.matrix))) == 0) {
            print("There are no gaps in the distance matrix")
            removed.taxa <- NULL
            out <- list(dist.matrix, Tree, removed.taxa)
            names(out) <- c("DistMatrix", "Tree", "RemovedTaxa")
            return(out)
        }
        else {
            node.nos <- as.character((ape::Ntip(Tree) + 1):(ape::Ntip(Tree) + 
                ape::Nnode(Tree)))
            for (i in match(node.nos, rownames(dist.matrix))) colnames(dist.matrix)[i] <- rownames(dist.matrix)[i] <- paste(sort(Tree$tip.label[FindDescendants(rownames(dist.matrix)[i], 
                Tree)]), collapse = "%%")
            removes <- vector(mode = "character")
            temp.dist.matrix <- dist.matrix
            while (length(which(is.na(dist.matrix))) > 0) {
                na.lengths <- vector(mode = "numeric")
                for (i in 1:length(dist.matrix[, 1])) na.lengths[i] <- length(which(is.na(dist.matrix[i, 
                  ])))
                taxon.to.delete <- rownames(dist.matrix)[which(na.lengths == 
                  max(na.lengths))[1]]
                delete.row <- which(rownames(dist.matrix) == 
                  taxon.to.delete)
                dist.matrix <- dist.matrix[-delete.row, -delete.row]
                removes <- c(removes, taxon.to.delete)
            }
            dist.matrix <- temp.dist.matrix
            tips.to.remove <- removes[sort(match(Tree$tip.label, 
                removes))]
            nodes.to.remove <- removes[grep("%%", removes)]
            tip.name.nodes.to.remove <- vector(mode = "numeric")
            for (i in tips.to.remove) {
                originating.node <- Tree$edge[match(which(Tree$tip.label == 
                  i), Tree$edge[, 2]), 1]
                originating.node.name <- paste(sort(Tree$tip.label[FindDescendants(originating.node, 
                  Tree)]), collapse = "%%")
                tip.name.nodes.to.remove <- unique(c(tip.name.nodes.to.remove, 
                  originating.node.name))
            }
            if (length(setdiff(nodes.to.remove, tip.name.nodes.to.remove)) > 
                0) {
                nodes.left.to.remove <- setdiff(nodes.to.remove, 
                  tip.name.nodes.to.remove)
                for (i in nodes.left.to.remove) {
                  originating.node <- FindAncestor(strsplit(i, 
                    "%%")[[1]], Tree)
                  descendant.nodes <- Tree$edge[which(Tree$edge[, 
                    1] == originating.node), 2]
                  if (length(which(descendant.nodes <= ape::Ntip(Tree))) > 
                    0) {
                    taxon.to.exclude <- Tree$tip.label[min(descendant.nodes)]
                  }
                  else {
                    if (length(FindDescendants(descendant.nodes[1], 
                      Tree)) >= length(FindDescendants(descendant.nodes[2], 
                      Tree))) {
                      taxon.to.exclude <- Tree$tip.label[FindDescendants(descendant.nodes[2], 
                        Tree)]
                    }
                    else {
                      taxon.to.exclude <- Tree$tip.label[FindDescendants(descendant.nodes[1], 
                        Tree)]
                    }
                  }
                  removes <- c(removes, taxon.to.exclude)
                  tips.to.remove <- c(tips.to.remove, taxon.to.exclude)
                }
            }
            dist.matrix <- dist.matrix[-match(removes, rownames(dist.matrix)), 
                -match(removes, rownames(dist.matrix))]
            for (i in 1:length(dist.matrix[, 1])) {
                nms <- strsplit(rownames(dist.matrix)[i], "%%")[[1]]
                rownames(dist.matrix)[i] <- colnames(dist.matrix)[i] <- paste(sort(nms[which(is.na(match(nms, 
                  tips.to.remove)))]), collapse = "%%")
            }
            redundant.rows <- c(which(duplicated(rownames(dist.matrix))), 
                which(rownames(dist.matrix) == ""))
            if (length(redundant.rows) > 0) {
                dist.matrix <- dist.matrix[-redundant.rows, -redundant.rows]
            }
            Tree <- drop.tip(Tree, tips.to.remove)
            node.names <- rownames(dist.matrix)[grep("%%", rownames(dist.matrix))]
            for (j in 1:length(node.names)) names(node.names)[j] <- FindAncestor(strsplit(node.names[j], 
                "%%")[[1]], Tree)
            colnames(dist.matrix)[match(node.names, colnames(dist.matrix))] <- rownames(dist.matrix)[match(node.names, 
                rownames(dist.matrix))] <- names(node.names)
            out <- list(dist.matrix, Tree, removes)
            names(out) <- c("DistMatrix", "Tree", "RemovedTaxa")
            return(out)
        }
    }
}
<bytecode: 0xb9e9a88>
<environment: namespace:Claddis>
 --- function search by body ---
Function TrimMorphDistMatrix in namespace Claddis has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1