[R] (no subject)

NICOLAS DEIG nicolas.deig at epfl.ch
Fri Dec 17 14:28:19 CET 2004


i am encoutering problems with a function of R concerning the
classification trees. 

In the library {tree}, when I use the function "tree" to grow a
classification tree it should give me an object of class "tree". Then I
should be allowed to use this "tree" object in the function "cv.tree"
that  requires an object of class "tree" in order to run a
cross-validation experiment. 
There is the problem, when I do this the following message appears:
"Error in as.data.frame.default(data) : can't coerce function into a
So instead of considering the object as an  object of class tree the
function "cv.tree" handles it like a data.frame.

Does anyone knows why or how to work on a class "tree" object so that
"cv.tree" can handle it?

Thanks in advance...
Nicolas Deig

More information about the R-help mailing list