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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: tree
> ### Title: Plot Trees
> ### Aliases: tree
> ### Keywords: tree multivariate
> 
> ### ** Examples
> 
> data(ohorizon)
> X=ohorizon[,"XCOO"]
> Y=ohorizon[,"YCOO"]
> el=log10(ohorizon[,c("Co","Cu","Ni","Rb","Bi","Na","Sr")])
> sel <- c(3,8,22, 29, 32, 35, 43, 69, 73 ,93,109,129,130,134,168,181,183,205,211,
+       218,237,242,276,292,297,298,345,346,352,372,373,386,408,419,427,441,446,490,
+       516,535,551,556,558,564,577,584,601,612,617)
> x=el[sel,]
> 
> tree(x,key.loc=c(15,0),len=0.022, lh=30,leglh=4,
+     wmax=120,wmin=30, leglen=0.05, ncol=8, cex=0.75)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
StatDA
 --- call from context --- 
.local(x, y, ...)
 --- call from argument --- 
if ((class(leg) != "NULL") & length(a@El) == 1) {
    text(xy.coords(points[2, 1], points[2, 2]), colnames(leg)[a@El], 
        cex = 0.8, adj = c(0.3, -0.2))
}
 --- R stacktrace ---
where 1: .local(x, y, ...)
where 2: plot(a, xleg, yleg, leglen, leglh, bcl)
where 3: plot(a, xleg, yleg, leglen, leglh, bcl)
where 4: tree(x, key.loc = c(15, 0), len = 0.022, lh = 30, leglh = 4, 
    wmax = 120, wmin = 30, leglen = 0.05, ncol = 8, cex = 0.75)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (a, x, y, len = 1, lh = 1, leg = NULL, ...) 
{
    points = matrix(0, nrow = 4, ncol = 2)
    if (a@LR == 0) {
        points[1, 1] = x
        points[1, 2] = y
        points[2, 1] = points[1, 1] - lh * len * a@h * sin(a@w * 
            2 * pi/360)
        points[2, 2] = points[1, 2] + lh * len * a@h * cos(a@w * 
            2 * pi/360)
        points[3, 1] = points[2, 1] + len * length(a@El)
        points[3, 2] = points[2, 2]
        points[4, 1] = points[1, 1] + len * length(a@El)
        points[4, 2] = points[1, 2]
        polygon(points)
        if ((class(leg) != "NULL") & length(a@El) == 1) {
            text(xy.coords(points[2, 1], points[2, 2]), colnames(leg)[a@El], 
                cex = 0.8, adj = c(0.3, -0.2))
        }
    }
    if (a@LR == 1) {
        points[1, 1] = x
        points[1, 2] = y
        points[2, 1] = points[1, 1] + lh * len * a@h * sin(a@w * 
            2 * pi/360)
        points[2, 2] = points[1, 2] + lh * len * a@h * cos(a@w * 
            2 * pi/360)
        points[3, 1] = points[2, 1] + len * length(a@El)
        points[3, 2] = points[2, 2]
        points[4, 1] = points[1, 1] + len * length(a@El)
        points[4, 2] = points[1, 2]
        polygon(points)
        if ((class(leg) != "NULL") & length(a@El) == 1) {
            text(xy.coords(points[2, 1], points[2, 2]), colnames(leg)[a@El], 
                cex = 0.8, adj = c(0, -0.2))
        }
    }
    if (class(a@LeafL) != "NULL") {
        if (a@LR == 0) 
            plot(a@LeafL, x - lh * len * a@h * sin(a@w * 2 * 
                pi/360), y + lh * len * a@h * cos(a@w * 2 * pi/360), 
                len, lh, leg)
        if (a@LR == 1) 
            plot(a@LeafL, x + lh * len * a@h * sin(a@w * 2 * 
                pi/360), y + lh * len * a@h * cos(a@w * 2 * pi/360), 
                len, lh, leg)
    }
    if (class(a@LeafR) != "NULL") {
        if (a@LR == 0) 
            plot(a@LeafR, x - lh * len * a@h * sin(a@w * 2 * 
                pi/360) + len * length(a@LeafL@El), y + lh * 
                len * a@h * cos(a@w * 2 * pi/360), len, lh, leg)
        if (a@LR == 1) 
            plot(a@LeafR, x + lh * len * a@h * sin(a@w * 2 * 
                pi/360) + len * length(a@LeafL@El), y + lh * 
                len * a@h * cos(a@w * 2 * pi/360), len, lh, leg)
    }
}
<bytecode: 0x558289e88368>
<environment: namespace:StatDA>
 --- function search by body ---
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1