[R] (no subject)

NICOLAS DEIG nicolas.deig at epfl.ch
Tue Dec 21 11:00:54 CET 2004


I am encoutering problems with a function of R. 
The function is for classification trees. 

I am working on datas of this kind:

       X1    X2    X3    X4    X5   class
1   2.092 1.902 2.779 2.944 1.946       1

for 200 observations and 4 differents classes.

What i would like to do is grow a tree with the function "tree" and then
use the result in the function "cv.tree" in order to ran cross
validation experiment. 
> library(tree)
> Z<-tree(V1~X1,data)
> W<-cv.tree(Z)
Error in as.data.frame.default(data) : can't coerce function into a

There is the problem, "cv.tree" won t consider the resluts of function
"tree" as an object of class tree, it just considers this object as a
data frame. 
Can anyone eyplain me why or already encoutered this kind of problem?

THanks in advance,

More information about the R-help mailing list