; load the library xclust
library ("xclust")
;let us generate a tree by cartsplit procedure
x1=#(0,0,0,0,1,1,1,1,1,2)
x2=#(0,0,0,0,0,0,0,1,1,1)
x=x1~x2
y=#(0,0,0,0,100,100,100,120,120,120)
cs=cartsplit(x,y,#(0,1))
cs
val1=ssr(cs,1)
val1
prcs=prunetot(cs,2)
val2=ssr(prcs,1)
val2
Content of object cs.val.split0
[1,] 0
[2,] 1,2
Content of object cs.val.split1
[1,] NaN
Content of object cs.val.split2
[1,] 0
Content of object cs.val.split3
[1,] NaN
Content of object cs.val.split4
[1,] NaN
Content of object cs.vec
[1,] 1.000000
[2,] NaN
[3,] 2.000000
[4,] NaN
[5,] NaN
Content of object cs.mean
[1,] 66.000000
[2,] 0.000000
[3,] 110.000000
[4,] 100.000000
[5,] 120.000000
Content of object cs.ssr
[1,] 29640.000000
[2,] 0.000000
[3,] 600.000000
[4,] 0.000000
[5,] 0.000000
Content of object cs.nelem
[1,] 10.000000
[2,] 4.000000
[3,] 6.000000
[4,] 3.000000
[5,] 3.000000
Content of object val1
[1,] 0.000000
Content of object prcs.val.split0
[1,] 0
[2,] 1,2
Content of object prcs.val.split1
[1,] NaN
Content of object prcs.val.split2
[1,] NaN
Content of object prcs.vec
[1,] 1.000000
[2,] NaN
[3,] NaN
Content of object prcs.mean
[1,] 66.000000
[2,] 0.000000
[3,] 110.000000
Content of object prcs.ssr
[1,] 29640.000000
[2,] 0.000000
[3,] 600.000000
Content of object prcs.nelem
[1,] 10.000000
[2,] 4.000000
[3,] 6.000000
Content of object val2
[1,] 600.000000