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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: match.spacodi.data
> ### Title: pruning a tree to match datasets used in SPACoDi
> ### Aliases: match.spacodi.data
> 
> ### ** Examples
> 
> # load a species-by-plots matrix, along with a tree
> data(sp.example)
> attributes(sp.example)
$names
[1] "spl" "phy" "trt" "dis"

> attach(sp.example)
> spl
     plot1 plot2 plot3 plot4 plot5 plot6 plot7 plot8 plot9 plot10
sp1      7     0     0     0     1     0     0     0     0      0
sp2      1     0     0     0     0     3     1     1     0     83
sp3      3     8     1     0     1     0     0     0     0      0
sp4      2     0     0     0     0     0     0     0     0      7
sp5      1     2     0     0     0     0     0     0     0      1
sp6      1     0     0     0     0     0     0     0     0      0
sp7      1     0     0     0     0     0     0     0     0     14
sp8     18    36     0     1     5     1     0     1     0      6
sp9      1     0     0     0     0     1     1     0     0      8
sp10    18     0     0     0     0     0     0     0     0     38
sp11    15    46     7     0    37     1     0     0     0     14
sp12     7     0     0     0     0     0     0     8     2      0
sp13     3     0    25     4     0    17     1    19     5      6
sp14     4     0     0     0     0     0     0     0     0      0
sp15     2     0     0     0     0     0     0     0     0      1
sp16     1     7    13     1    10     0     0     0     0      0
sp17     1     0     1     0     0     0     0     0     0      0
sp18     2     0     1     0     0     0     0     0     0      1
sp19     4     1     0     1     0     0     0     0     0      1
sp20     1     3     0     1     0     0     0     0     0      0
> phy

Phylogenetic tree with 20 tips and 19 internal nodes.

Tip labels:
	sp1, sp2, sp3, sp4, sp5, sp6, ...

Rooted; includes branch lengths.
> trt
     trt.1 trt.2
sp1   0.21    10
sp2   0.02    10
sp3   0.78     5
sp4   0.05     8
sp5   0.56     6
sp6   0.28    12
sp7   0.33     1
sp8   0.65    10
sp9   0.23     9
sp10  0.62     7
sp11  0.06     5
sp12  0.30    18
sp13  0.18    10
sp14  0.82    10
sp15  0.64    11
sp16  0.41    16
sp17  0.03     4
sp18  0.42    12
sp19  0.76    16
sp20  0.05     5
> 
> # prune out undersampled plots
> spl[,2]=0
> match.spacodi.data(spl) -> sp.plot.new
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spacodiR
 --- call from context --- 
reorderspacodiobj(sp.plot, usable.species)
 --- call from argument --- 
if (class(obj) == "phylo") {
    obj.labels = obj$tip.label
    if (any(!obj.labels %in% names)) 
        obj = drop.tip(obj, obj.labels[!obj.labels %in% names])
    else obj = obj
} else if (check.distmat(obj)) {
    obj.labels = rownames(obj)
    obj = as.matrix(obj[match(names, obj.labels), match(names, 
        obj.labels)])
    rownames(obj) <- colnames(obj) <- names
} else {
    nn = colnames(obj)
    obj.labels = rownames(obj)
    obj = as.data.frame(obj[match(names, obj.labels), ])
    names(obj) = nn
}
 --- R stacktrace ---
where 1: reorderspacodiobj(sp.plot, usable.species)
where 2: rownames(sp.plot)
where 3: prune.sp(reorderspacodiobj(sp.plot, usable.species), verbose = verbose)
where 4: match.spacodi.data(spl)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (obj, names) 
{
    if (class(obj) == "phylo") {
        obj.labels = obj$tip.label
        if (any(!obj.labels %in% names)) 
            obj = drop.tip(obj, obj.labels[!obj.labels %in% names])
        else obj = obj
    }
    else if (check.distmat(obj)) {
        obj.labels = rownames(obj)
        obj = as.matrix(obj[match(names, obj.labels), match(names, 
            obj.labels)])
        rownames(obj) <- colnames(obj) <- names
    }
    else {
        nn = colnames(obj)
        obj.labels = rownames(obj)
        obj = as.data.frame(obj[match(names, obj.labels), ])
        names(obj) = nn
    }
    if (!all(names %in% obj.labels)) 
        warning(paste(paste(names[!names %in% obj.labels], sep = " ", 
            collapse = " "), "were not found in the supplied object", 
            sep = " "))
    return(obj)
}
<bytecode: 0xc4d9688>
<environment: namespace:spacodiR>
 --- function search by body ---
Function reorderspacodiobj in namespace spacodiR has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(obj) == "phylo") { : the condition has length > 1
Calls: match.spacodi.data -> prune.sp -> rownames -> reorderspacodiobj
Execution halted